From cec5e2fcb2ff984c6b4e9defe30442f873cf79e3 Mon Sep 17 00:00:00 2001 From: WuYongJie Date: Mon, 29 Jun 2026 13:11:13 +0800 Subject: [PATCH] fix(intake): prevent barcode print stretching --- .../app/intake/barcode-print/barcodePrintLodop.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/furniture-3d-system/src/app/intake/barcode-print/barcodePrintLodop.ts b/furniture-3d-system/src/app/intake/barcode-print/barcodePrintLodop.ts index 1f941899..27cbd39e 100644 --- a/furniture-3d-system/src/app/intake/barcode-print/barcodePrintLodop.ts +++ b/furniture-3d-system/src/app/intake/barcode-print/barcodePrintLodop.ts @@ -312,8 +312,14 @@ function printCommonLayout( lodop.ADD_PRINT_TEXT(203, 474, 141, 25, record.bar3); setFont(lodop, 15); } else { - lodop.ADD_PRINT_TEXT(203, 191, 800, options?.barcodeTextHeight ?? 25, record.barcode); - setFont(lodop, options?.barcodeFontSize ?? 25, true); + // Keep the full barcode on a single row and shrink text when needed. + const barcodeTextHeight = options?.barcodeTextHeight ?? 25; + const barcodeFontSize = options?.barcodeFontSize ?? 25; + lodop.ADD_PRINT_TEXT(203, 191, 800, barcodeTextHeight, record.barcode); + setFont(lodop, barcodeFontSize, true); + lodop.SET_PRINT_STYLEA(0, "TextNeatRow", 1); + lodop.SET_PRINT_STYLEA(0, "WordWrap", 0); + lodop.SET_PRINT_STYLEA(0, "TextFit", 1); } lodop.ADD_PRINT_TEXT(182, options?.productionBatchLeft ?? 438, 172, 25, `生产批号:${record.printDate}`); @@ -486,7 +492,7 @@ export async function printBarcodeRow( } lodop.NEWPAGE(); - lodop.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "Full-Page"); + // Print using the configured paper size to avoid stretched output. template.printFunc(record, lodop, { batchNumber: options.batchNumber }); lodop.PREVIEW(); return template.title; @@ -803,7 +809,7 @@ export async function printCertificateRow( } lodop.NEWPAGE(); - lodop.SET_PRINT_MODE("PRINT_PAGE_PERCENT", "Full-Page"); + // Print using the configured paper size to avoid stretched output. printCertificateLayout(record, lodop, template, options); lodop.PREVIEW(); return template.title;