CreatePdfZXingBarcodeProvider는 ZXing-C++ 2.3.0으로 빌드한 대상 환경에 맞는 네이티브 브리지의 절대 경로를 받아 IPdfBarcodeProvider를 제공합니다
TryCreatePdfZXingBarcodeProvider는 프로세스의 검색 경로를 바꾸지 않고 라이브러리나 export 누락, 호환되지 않는 브리지 ABI를 보고합니다
Code128, QR, DataMatrix, PDF417을 생성하며 요청한 모듈 크기의 검은 벡터 사각형을 반환합니다. Code128은 지원하는 문자 집합을 받으며 매트릭스 코드는 Unicode 텍스트를 지원합니다
QuietZoneModules는 검은 사각형을 왼쪽과 위쪽에서 띄웁니다. 결과를 배치하거나 래스터화할 때는 호출자가 오른쪽과 아래쪽에도 흰 여백을 확보해야 합니다
인식 입력은 위에서 아래 순서의 1바이트 회색조 데이터와 명시적인 너비, 높이, stride입니다. 경계는 반열린 픽셀 사각형이며 confidence 1은 디코딩 성공을 뜻하고 통계적 확률은 아닙니다
기본 상한은 4,194,304픽셀, UTF-8 텍스트 32,768바이트, 벡터 사각형 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 실행에서 회전, 반전, Unicode를 포함한 인코딩/디코딩 왕복 60회를 검증했습니다. 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;