Multi-symbol Raster Barcode Scanning

HPDFCreateBuiltInBarcodeDecoder scans multiple separated symbols in the same raster, including mixed linear, QR Code, Data Matrix ECC 200, and PDF417 symbols supported by the native decoders

The existing DecodeLoadedPageBarcodes overload automatically uses this scanner and retains each result's pixel bounds before the page pipeline maps them to PDF coordinates

Results are sorted by top position and then left position, and duplicate detections are merged only when symbology, text, raw bytes, and overlapping position agree; identical payloads at separate positions remain separate results

Native helper and geometry

HPDFBarcodeRecognitionScan exports HPDFScanBarcodeBitmap for callers that need the richer THPDFBarcodeScanSymbols array and THPDFBarcodeScanInfo statistics

Pass a THPDFBarcodeDecodeRequest, HPDFCreateBuiltInSingleBarcodeDecoder, and THPDFBarcodeScanOptions.Default; the single-symbol factory also preserves direct access to the original decoder for application-specific region selection

HPDFCreateScanningBarcodeDecoder wraps a supplied single-symbol IHPDFBarcodeDecoder with the same region scanning, duplicate suppression, and aggregate budgets for applications that only need the ordinary decoder interface

Each THPDFBarcodeScanSymbol contains the ordinary Barcode record, four raster Corners, HasPerspectiveGeometry, and a per-symbol Diagnostic

Data Matrix geometry derives a convex hull from foreground row extrema, recovers four edge lines, intersects adjacent lines, and solves an eight-parameter homography to sample module centers with a five-point majority vote

The decoder tries supported square and standard rectangular ECC 200 sizes, rotations, and mirrors, then verifies finder borders and Reed-Solomon blocks before returning text or raw bytes; rotation and trapezoidal projection can be combined with correctable data-module damage

For verified Data Matrix geometry, OrientationDegrees measures the canonical top edge clockwise from the raster's positive x axis, while Corners follow the detected hull clockwise with an unspecified starting corner

HPDFDataMatrixGeometry exports HPDFLocateDataMatrixQuadrilateral and HPDFSampleBarcodeQuadrilateral, and HPDFDataMatrixDecoder exports HPDFDecodeDataMatrixQuadrilateral for applications that already know the four projected corners

The confidence values describe the decoder's verification path, rather than a calibrated statistical probability; projectively sampled ECC 200 results currently report 0.90 after successful border and error-correction verification

For other native symbologies, the helper's corners describe the returned axis-aligned bounds and HasPerspectiveGeometry is false; their existing confidence and orientation values are retained

Budgets and atomic publication

The scanner uses Otsu binarization and four-pixel occupancy tiles, then connects matrix foreground regions from the largest of three bounded neighborhood distances toward smaller distances; this tries a complete rotated symbol before disconnected fragments while retaining tighter retries for separated symbols and the full-raster fallback for unusual scale or connected artwork

Regions whose foreground tiles are already covered by verified results are skipped before decoding, and the caller's source bitmap pixels and pixel format are preserved

Default limits are 256 candidate decodes, 67,108,864 total candidate pixels, 268,435,456 estimated working bytes, and a two-second request deadline; the original 4096 by 4096 dimension and 4,194,304-pixel input ceilings remain enforced

MaxResults, MaxTextCodeUnits, and MaxRawBytes in the request apply to the aggregate published result set, including repeated payloads at different locations

THPDFBarcodeScanInfo reports attempted candidate count, cumulative decoded pixels, rejected candidates, and overlapping duplicate results

Cancellation propagates as EHPDFOperationCancelled; exhausted budgets or decoder errors return false with a diagnostic, and all failures leave the symbol array empty even after earlier candidates were successfully decoded

Blank or uniformly low-contrast input completes successfully with an empty array, and unsupported high-contrast artwork returns no guessed symbol

Recognition scope

Matrix scanning tries larger connected groups before tighter fragments, preserving separated-symbol retries and the original deadline; native QR geometry validates exact finder patterns before allocating and sampling the full candidate grid

Multiple symbols need enough visible background separation for region grouping; touching symbols, overlapping symbols, dense surrounding artwork, severely damaged locator borders, tiny projected modules, and extreme perspective can prevent localization

DMRE, curved surfaces, photographic glare recovery, and additional symbologies beyond the existing native decoder set remain outside this profile

Independent fixtures cover a six-symbol collage with repeated QR payloads, rotated and trapezoidal Data Matrix images, rectangular ECC 200, and combined perspective with correctable data-module damage

See Built-in OCR and Barcode Recognition for the supported payload modes and Loaded Page Barcode Decoding for page-to-raster coordinate mapping