PdfImagesExtractor

Allows to extract image files from pdf files

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard

The callback to process extracted PDF page image with continuation control.

Link copied to clipboard

The callback to process extracted PDF page.

Link copied to clipboard

The type of the PdfImagesExtractor. ANDROID_PDF_WRITER is the default implementation

Functions

Link copied to clipboard
open fun <T> executeWithResultHandling(operation: () -> T): Result<T>

Executes the provided operation and wraps any exceptions in appropriate Result types.

Link copied to clipboard
abstract 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.

abstract fun extract(pdfFile: File, cancelCallback: LongOperationCancelCallback? = null, progressCallback: ProgressCallback? = null, processingCallback: PdfImagesExtractor.PdfImageProcessingCallback? = null): Result<List<ImageRef>>
abstract fun extract(pdfFile: File, outputDir: File, prefix: String, compression: Bitmap.CompressFormat = Bitmap.CompressFormat.JPEG, quality: Int = DEFAULT_COMPRESSION_QUALITY, scaling: Float = DEFAULT_SCALING, bitmapConfig: Bitmap.Config = Bitmap.Config.ARGB_8888, cancelCallback: LongOperationCancelCallback? = null, progressCallback: ProgressCallback? = null, processingCallback: PdfImagesExtractor.PdfImageProcessingCallback? = null): 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.