pdftools_sdk.ocr.barcode_options

Classes

BarcodeOptions()

Options for barcode and QR code recognition

class pdftools_sdk.ocr.barcode_options.BarcodeOptions[source]

Bases: _NativeObject

Options 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 on pdftools_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.ImageOptions and pdftools_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”) to pdftools_sdk.ocr.processor.Processor.process() ; (2) set pdftools_sdk.ocr.barcode_options.BarcodeOptions.mode to pdftools_sdk.ocr.barcode_handling.BarcodeHandling.EMBED or pdftools_sdk.ocr.barcode_handling.BarcodeHandling.EXTRACT ; (3) configure pdftools_sdk.ocr.page_options.PageOptions or pdftools_sdk.ocr.image_options.ImageOptions so that pages are submitted to the engine (typically pdftools_sdk.ocr.page_options.PageOptions.mode = pdftools_sdk.ocr.page_processing_mode.PageProcessingMode.ALL ).

Setting pdftools_sdk.ocr.barcode_options.BarcodeOptions.mode alone has no effect.

Note: Available only on Windows x86 and x64.

__init__()[source]
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