PDFReadBarcodes
Barcode recognition, document inspection, rendering
Description
Decodes barcodes from a raw bitmap using the built-in 1D and 2D reader engine
Syntax
Delphi
Function PDFReadBarcodes(Data: Pointer; BufferSize, Width, Height,
RowStride, Formats, Options, MaxResults: Integer;
Var Results: TPDFBarcodeResults; Var ErrorMessage: WideString): Boolean;Parameters
| Data | Pointer to the first pixel of a top-down bitmap; rows hold 24-bit BGR pixels, or 32-bit BGRA when RowStride is at least Width times 4 |
|---|---|
| BufferSize | Readable byte size of the buffer |
| Width, Height | Bitmap dimensions in pixels |
| RowStride | Bytes per row, including padding |
| Formats | Bit mask of PDF_BARCODE_FORMAT_* constants; 0 tries every supported symbology |
| Options | Bit mask of PDF_BARCODE_DISABLE_* flags for rotate, invert and downscale passes |
| MaxResults | Upper bound on returned results, from 1 through 255 |
| Results | Receives the decoded records with text, position, orientation and metadata |
| ErrorMessage | Receives a diagnostic message when the call fails |
Return values
| True | At least the decode pass ran; Results may still be empty when no barcode was found |
|---|---|
| False | The bitmap parameters are invalid or the buffer is unreadable; ErrorMessage carries the reason |
Remarks
The engine behind DetectPageBarcodesJSON; call it directly when the pixels come from a camera or scanner instead of a PDF page
Every result carries Format, ContentType, Orientation, corner Position points, the decoded Text and symbology metadata such as FormatName, SymbologyIdentifier and ErrorCorrectionLevel
See also
PDFBarcodeResultsJSON, DetectPageBarcodesJSON, DrawAztecCode