pdftools_sdk.ocr.barcode_options
Classes
Options for barcode and QR code recognition |
- class pdftools_sdk.ocr.barcode_options.BarcodeOptions[source]
Bases:
_NativeObjectOptions for barcode and QR code recognition
Detected barcodes are written either to the document’s XMP metadata (
pdftools_sdk.ocr.barcode_handling.BarcodeHandling.EMBED) or to a caller-supplied XML stream (pdftools_sdk.ocr.barcode_handling.BarcodeHandling.EXTRACT), depending onpdftools_sdk.ocr.barcode_options.BarcodeOptions.mode.Barcode detection is performed by the OCR engine and depends on the type and settings of the engine as well as the parameters
pdftools_sdk.ocr.image_options.ImageOptionsandpdftools_sdk.ocr.page_options.PageOptions. To enable recognition, all three of the following must be configured: (1) pass an engine created with Engine.Create(“barcodes”) topdftools_sdk.ocr.processor.Processor.process(); (2) setpdftools_sdk.ocr.barcode_options.BarcodeOptions.modetopdftools_sdk.ocr.barcode_handling.BarcodeHandling.EMBEDorpdftools_sdk.ocr.barcode_handling.BarcodeHandling.EXTRACT; (3) configurepdftools_sdk.ocr.page_options.PageOptionsorpdftools_sdk.ocr.image_options.ImageOptionsso that pages are submitted to the engine (typicallypdftools_sdk.ocr.page_options.PageOptions.mode=pdftools_sdk.ocr.page_processing_mode.PageProcessingMode.ALL).Setting
pdftools_sdk.ocr.barcode_options.BarcodeOptions.modealone has no effect.Note: Available only on Windows x86 and x64.
- property mode: BarcodeHandling
How recognized barcodes are returned
Default value:
pdftools_sdk.ocr.barcode_handling.BarcodeHandling.NONE- Returns:
pdftools_sdk.ocr.barcode_handling.BarcodeHandling
- property xml_output_stream: IOBase | None