From f46121bf88ab00a28b388ffd1b47a8f5f13404e7 Mon Sep 17 00:00:00 2001 From: u8array Date: Thu, 7 May 2026 16:41:05 +0200 Subject: [PATCH 1/2] Update Aztec barcode ZPL generation Modify the `toZPL` function for Aztec barcodes to correctly include the error correction level (`ecLevel`) in the ZPL command. Previously, a fixed `N` was used for this parameter, which is incorrect. This change also updates the corresponding test fixtures to reflect the correct ZPL generation. --- src/registry/aztec.tsx | 7 ++++--- tests/fixtures/labelary_images/fixtures.json | 2 +- tests/fixtures/testCases.ts | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/registry/aztec.tsx b/src/registry/aztec.tsx index e5751847..4933f41a 100644 --- a/src/registry/aztec.tsx +++ b/src/registry/aztec.tsx @@ -26,11 +26,12 @@ export const aztec: ObjectTypeDefinition = { toZPL: (obj) => { const p = obj.props; - // ^B0{orientation},{magnification},{ecic},{menuSymbol},{numberOfSymbols},{structuredID} - // Also ^BO (alternate) — we use ^B0 as canonical + // ^B0 a,b,c,d,e,f,g = orientation, magnification, ecic, errorControl, + // menuSymbol, numberOfSymbols, structuredID. ecLevel=0 is Zebra's + // documented default for errorControl, so emitting it as-is is valid. return [ fieldPos(obj), - `^B0${p.rotation},${p.magnification},N,N,N,N`, + `^B0${p.rotation},${p.magnification},N,${p.ecLevel}`, fdField(p.content), ].join(""); }, diff --git a/tests/fixtures/labelary_images/fixtures.json b/tests/fixtures/labelary_images/fixtures.json index 6450174d..16e71f7f 100644 --- a/tests/fixtures/labelary_images/fixtures.json +++ b/tests/fixtures/labelary_images/fixtures.json @@ -123,7 +123,7 @@ }, { "id": "barcode_aztec_standard", - "zpl_input": "^XA^FO50,50^B0N,4,N,N,N,N^FDAztec123^FS^XZ", + "zpl_input": "^XA^FO50,50^B0N,4,N,0^FDAztec123^FS^XZ", "expected_bounds": { "x": 50, "y": 50, diff --git a/tests/fixtures/testCases.ts b/tests/fixtures/testCases.ts index edbafbae..301a2a0b 100644 --- a/tests/fixtures/testCases.ts +++ b/tests/fixtures/testCases.ts @@ -80,7 +80,7 @@ export const testCases: TestCase[] = [ }, { id: "barcode_aztec_standard", - zpl_input: "^XA^FO50,50^B0N,4,N,N,N,N^FDAztec123^FS^XZ", + zpl_input: "^XA^FO50,50^B0N,4,N,0^FDAztec123^FS^XZ", expected_bounds: { x: 50, y: 50, width: 100, height: 100 }, image_ref: "barcode_aztec_standard.png", }, From ca4052145a22c3ef1c4a7257cbcead39eaad34bb Mon Sep 17 00:00:00 2001 From: u8array Date: Thu, 7 May 2026 16:53:01 +0200 Subject: [PATCH 2/2] Update ecLevel description for Aztec code --- src/registry/aztec.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/registry/aztec.tsx b/src/registry/aztec.tsx index 4933f41a..1b527886 100644 --- a/src/registry/aztec.tsx +++ b/src/registry/aztec.tsx @@ -8,7 +8,7 @@ import { RotationSelect } from "../components/Properties/RotationSelect"; export interface AztecProps { content: string; magnification: number; // 1–10, module size in dots - ecLevel: number; // 0 = auto, 1–99 error correction percentage, 201–232 for layers + ecLevel: number; // 0=default, 1-99=error correction %, 101-104=compact, 201-232=full, 300=rune rotation: ZplRotation; }