PDFBarcodeResultsJSON

Barcode recognition, document inspection, rendering

Description

Formats barcode decode results as a JSON object carrying the page number, the covered region and the pixel-to-page mapping

Syntax

Delphi

Function PDFBarcodeResultsJSON(Const Results: TPDFBarcodeResults;
  Page: Integer; Left, Top, Width, Height, DPI, PixelScale: Double): WideString;

Parameters

ResultsDecode records produced by PDFReadBarcodes
PageOne-based page number written into each record
Left, Top, Width, HeightPage rectangle the bitmap covers, in current measurement units
DPIResolution the bitmap was rendered or captured at
PixelScalePixels per current measurement unit, for example DPI divided by 72 when the unit is the point; a non-positive or non-finite value leaves each corner position as a raw pixel offset from Left and Top

Return values

A JSON object holding the page number, the DPI, the covered region and the result count, plus a results array with one object per barcode containing the text, format, position in page units, orientation and metadata; when nothing was found the object is still returned with a count of 0 and an empty results array

Remarks

This is the serialization step DetectPageBarcodesJSON runs after PDFReadBarcodes on a rendered page image

Bitmap corner points are offset by the rectangle origin and divided by PixelScale so the JSON positions land in page space; DPI is reported in the output but takes no part in the mapping

See also

PDFReadBarcodes, DetectPageBarcodesJSON