Import Images from PDF | React Native Document Scanner
Extract Images from PDF
This API function allows you to extract JPG images from a PDF file.
ScanbotSDK.extractImagesFromPdf(
args: ExtractImagesFromPdfArguments
): Promise<ExtractImagesFromPdfResult>
Arguments
interface ExtractImagesFromPdfArguments {
/**
* The location of the PDF file
*/
pdfFilePath: string;
/**
* The quality that each extracted image should have.
* This tweaks the compression, affecting the final image file size.
* (100: maximum quality, 0: minimum quality)
*
* Default value is 90
*/
quality?: number;
/**
* Integer scaling factor applied to the PDF media box frame while extracting.
* Affects the output image quality.
* In most cases the recommended value is 2 or higher.
*
* Default value is 2.
*/
scaling?: number;
}
Returns
Returns an object with the following properties:
status
- The status of the operation (OK or CANCELED)imageFilesUrls
- A list containing the file URLs for the extracted images, or undefined if the extraction failed
Extract Pages from PDF
This API function allows you to extract pages from a PDF file.
ScanbotSDK.extractPagesFromPdf(
args: ExtractPagesFromPdfArguments
): Promise<ExtractPagesFromPdfResult>
Arguments
interface ExtractPagesFromPdfArguments {
/**
* The location of the PDF file
*/
pdfFilePath: string;
/**
* The quality that each extracted image should have.
* This tweaks the compression, affecting the final image file size.
* (100: maximum quality, 0: minimum quality)
*
* Default value is 90
*/
quality?: number;
/**
* Integer scaling factor applied to the PDF media box frame while extracting.
* Affects the output image quality.
* In most cases the recommended value is 2 or higher.
*
* Default value is 2.
*/
scaling?: number;
}
Returns
Returns an object with the following properties:
status
- The status of the operation (OK or CANCELED)pages
- A list containing the extracted pages, or undefined if the extraction failed
Want to scan longer than one minute?
Generate a free trial license to test the Scanbot SDK thoroughly.
Get your free Trial LicenseWhat do you think of this documentation?
What can we do to improve it? Please be as detailed as you like.