Class MultiPageImageExtractor

  • All Implemented Interfaces:
    java.lang.AutoCloseable

    public class MultiPageImageExtractor
    extends java.lang.Object
    implements java.lang.AutoCloseable
    API for extracting images from multi-page images (PDF, TIFF) and single-page images (JPEG, PNG). Required licence feature(s): ImageProcessing.
    • Constructor Detail

      • MultiPageImageExtractor

        public MultiPageImageExtractor()
        Constructs MultiPageImageExtractor with the given params.
    • Method Detail

      • run

        public PageExtractionResult run​(RandomAccessSource source)
                                 throws InvalidDataException,
                                        InvalidImageRefException,
                                        LicenseException,
                                        java.io.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 invalid
        InvalidImageRefException - If an invalid image reference is used
        LicenseException - If license requirements for the API are not met
        java.io.IOException - If an input/output error occurs
      • close

        public void close()
        Closes native resources held by the object.
        Specified by:
        close in interface java.lang.AutoCloseable
      • finalize

        protected void finalize()
                         throws java.lang.Throwable
        Overrides:
        finalize in class java.lang.Object
        Throws:
        java.lang.Throwable