Class BarcodeOptions
- java.lang.Object
-
- com.pdftools.internal.NativeBase
-
- com.pdftools.internal.NativeObject
-
- com.pdftools.ocr.BarcodeOptions
-
public class BarcodeOptions extends NativeObject
Options for barcode and QR code recognition
Detected barcodes are written either to the document's XMP metadata (
BarcodeHandling.EMBED) or to a caller-supplied XML stream (BarcodeHandling.EXTRACT), depending ongetMode().Barcode detection is performed by the OCR engine and depends on the type and settings of the engine as well as the parameters
ImageOptionsandPageOptions. To enable recognition, all three of the following must be configured: (1) pass an engine created withEngine.Create("barcodes")toProcessor.process(com.pdftools.pdf.Document, com.pdftools.ocr.Engine, com.pdftools.sys.Stream); (2) setgetMode()toBarcodeHandling.EMBEDorBarcodeHandling.EXTRACT; (3) configurePageOptionsorImageOptionsso that pages are submitted to the engine (typicallyPageOptions.getMode()=PageProcessingMode.ALL).Setting
getMode()alone has no effect.Note: Available only on Windows x86 and x64.
-
-
Constructor Summary
Constructors Constructor Description BarcodeOptions()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BarcodeHandlinggetMode()How recognized barcodes are returned (Getter)voidsetMode(BarcodeHandling value)How recognized barcodes are returned (Setter)voidsetXmlOutputStream(Stream value)Stream that receives recognized barcodes as XML (Setter)-
Methods inherited from class com.pdftools.internal.NativeObject
equals, hashCode
-
-
-
-
Method Detail
-
getMode
public BarcodeHandling getMode()
How recognized barcodes are returned (Getter)
Default value:BarcodeHandling.NONE
-
setMode
public void setMode(BarcodeHandling value)
How recognized barcodes are returned (Setter)
Default value:BarcodeHandling.NONE- Throws:
java.lang.IllegalArgumentException- ifvalueisnull
-
setXmlOutputStream
public void setXmlOutputStream(Stream value)
Stream that receives recognized barcodes as XML (Setter)
Required if and only if
getMode()isBarcodeHandling.EXTRACT.Default value:
null
-
-