Class MultiPageImageExtractor
java.lang.Object
io.scanbot.sdk.multipageimageextractor.MultiPageImageExtractor
- All Implemented Interfaces:
AutoCloseable
API for extracting images from multi-page images (PDF, TIFF) and single-page images (JPEG, PNG).
Required licence feature(s): ImageProcessing.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs MultiPageImageExtractor with the given params. -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Closes native resources held by the object.protected voidfinalize()run(RandomAccessSource source) Extracts images from the given source.
-
Constructor Details
-
MultiPageImageExtractor
public MultiPageImageExtractor()Constructs MultiPageImageExtractor with the given params.
-
-
Method Details
-
run
public PageExtractionResult run(RandomAccessSource source) throws InvalidDataException, InvalidImageRefException, LicenseException, IOException Extracts images from the given source. If possible, images that are originally stored in a compressed way, are not decompressed automatically but are initialized in a lazy way. This means that the image data is only decompressed when it is accessed for the first time. That's why when the images are used after extraction, it is recommended to close (dispose) (if platform uses Garbage Collector) images as soon as they are not needed anymore to prevent storing a lot of images in decompressed state in memory. After the method is executed, the source doesn't have to exist anymore.- Parameters:
source- The source to extract images from. Supported multi-page image formats are TIFF and PDF. Supported single page image formats are JPEG and PNG.- Returns:
- The result of the extraction.
- Throws:
InvalidDataException- If input data is invalidInvalidImageRefException- If an invalid image reference is usedLicenseException- If license requirements for the API are not metIOException- If an input/output error occurs
-
close
public void close()Closes native resources held by the object.- Specified by:
closein interfaceAutoCloseable
-
finalize
-