CreatePdfZXingBarcodeProvider 透過明確的絕對路徑載入以 ZXing-C++ 2.3.0 建置、架構符合目標平台的原生橋接程式,提供 IPdfBarcodeProvider
TryCreatePdfZXingBarcodeProvider 會回報缺少的程式庫、匯出符號或不相容的橋接 ABI,不會變更程序的搜尋路徑
產生功能支援 Code128、QR、DataMatrix 與 PDF417,依要求的模組尺寸傳回黑色向量矩形;Code128 接受其支援的字元集,矩陣條碼則支援 Unicode 文字
QuietZoneModules 會在左側與上方位移黑色矩形;放置或點陣化結果時,呼叫端也必須在右側與下方保留白色淨空區
辨識接受由上而下、每像素一個位元組的灰階資料,以及明確的寬度、高度與列間距;邊界為半開的像素矩形,信心值 1 表示解碼結果被接受,並非統計機率
預設預算為 4,194,304 個像素、32,768 個 UTF-8 文字位元組及 1,000,000 個向量矩形,淨空區為 4,錯誤更正等級為 2
QR 錯誤更正等級 0–2 對應 L、3–4 對應 M、5–6 對應 Q、7–8 對應 H;PDF417 使用 0–8;Code128 與 DataMatrix 忽略此選項
即使要求的上限更高,辨識最多仍傳回 255 個符號;現有提供者介面沒有取消權杖
建置說明與可執行的編碼/解碼範例位於 Native/BarcodeZXing 與 Tests/BarcodeProvider;此次變更未附帶原生橋接二進位檔或相依項目原始碼
實際 Delphi/FPC Win32/Win64 執行通過 60 次編碼/解碼往返,涵蓋旋轉、反相及 Unicode;原生 Linux 橋接執行通過 15 次往返,Pascal 提供者仍受包裝程式的 Windows 相依項目限制
Provider := CreatePdfZXingBarcodeProvider( BridgePath, TPdfZXingBarcodeOptions.Default); Rects := GeneratePdfBarcode(pbkQr, 'Invoice 12345', 2, Provider); Results := RecognisePdfBarcodes(Pixels, Width, Height, Stride, Provider, 256);
type
EPdfBarcodeBackendError = class(EPdfProduction);
TPdfZXingBarcodeOptions = record
MaxPixels: Int64;
MaxTextBytes: Integer;
MaxRectangles: Integer;
QuietZoneModules: Integer;
ErrorCorrectionLevel: Integer;
class function Default: TPdfZXingBarcodeOptions; static;
end;
// Recognition accepts top-down, one-byte grayscale pixels with explicit stride
// Bounds are half-open pixel rectangles; Confidence=1 denotes a valid decode
// The backend does not supply a statistical confidence estimate
// A recognition call returns at most 255 symbols, even with a higher requested limit
function CreatePdfZXingBarcodeProvider(const BridgeLibraryPath: string;
const Options: TPdfZXingBarcodeOptions): IPdfBarcodeProvider;
function TryCreatePdfZXingBarcodeProvider(const BridgeLibraryPath: string;
const Options: TPdfZXingBarcodeOptions; out Provider: IPdfBarcodeProvider;
out ErrorMessage: string): Boolean;