extract

open override fun extract(pdfFile: File, outputDir: File, prefix: String, compression: Bitmap.CompressFormat, quality: Int, scaling: Float, bitmapConfig: Bitmap.Config, cancelCallback: LongOperationCancelCallback?, progressCallback: ProgressCallback?, processingCallback: PdfImagesExtractor.PdfImageProcessingCallback?): Result<List<Uri>>

Converts pdf document to separate image files with given options. If the encryption of sdk is enabled all images WILL be encrypted.

Return

Result containing list of uris of image files, or failure if operation fails

Parameters

pdfFile

input pdf document

outputDir

directory, where the output files will be stored

prefix

prefix for output image files, naming will be _.

compression

bitmap compress format to use. JPEG by default

quality

compression quality. 90 by default

scaling

size of the image modifier. 2 by default

bitmapConfig

bitmap config to use. ARGB_8888 by default

cancelCallback

callback that can cancel the operation during the extraction of pages

progressCallback

callback that can get the number of pages already processed during the extraction of pages


open override fun extract(pdfFile: File, cancelCallback: LongOperationCancelCallback?, progressCallback: ProgressCallback?, processingCallback: PdfImagesExtractor.PdfImageProcessingCallback?): Result<List<ImageRef>>

Converts pdf document to separate image files with given options. If the encryption of sdk is enabled all images WILL be encrypted.

Return

Result containing list of ImageRef objects, or failure if operation fails

Parameters

pdfFile

input pdf document

cancelCallback

callback that can cancel the operation during the extraction of pages

progressCallback

callback that can get the number of pages already processed during the extraction of pages

processingCallback

the block to process extracted PDF page image.


open override fun extract(pdfFile: File, processingCallback: PdfImagesExtractor.PdfImageExtractingCallback): Result<Unit>

Extracts and processes images from PDF document with custom processing logic and continuation control. Processing stops when the callback returns false or all pages are processed.

Return

Result containing Unit on success, or failure if operation fails

Parameters

pdfFile

input pdf document

processingCallback

the block to process extracted PDF page image and determine whether to continue processing