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

DataPointer 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
BufferSizeReadable byte size of the buffer
Width, HeightBitmap dimensions in pixels
RowStrideBytes per row, including padding
FormatsBit mask of PDF_BARCODE_FORMAT_* constants; 0 tries every supported symbology
OptionsBit mask of PDF_BARCODE_DISABLE_* flags for rotate, invert and downscale passes
MaxResultsUpper bound on returned results, from 1 through 255
ResultsReceives the decoded records with text, position, orientation and metadata
ErrorMessageReceives a diagnostic message when the call fails

Return values

TrueAt least the decode pass ran; Results may still be empty when no barcode was found
FalseThe 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