From 2f1675af1de3b41b7ad46844ca92fed41b9956ff Mon Sep 17 00:00:00 2001 From: grabowski Date: Mon, 13 Apr 2026 09:52:01 +0700 Subject: [PATCH] Fix 2-page label: reset @page margin to 0, shrink barcode to fit MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The custom @page margins conflicted with browser minimum margins, causing overflow. Now @page margin is 0, barcode height 8mm→6mm, scale 3→2, text size 12→10 so content fits within 29mm even with browser minimum margins selected. Co-Authored-By: Claude Opus 4.6 (1M context) --- src/lib/server/barcode.ts | 4 ++-- src/routes/(print)/print/batch/+page.svelte | 6 +++--- src/routes/(print)/print/component/[id]/+page.svelte | 6 +++--- src/routes/(print)/print/device/[id]/+page.svelte | 6 +++--- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/lib/server/barcode.ts b/src/lib/server/barcode.ts index 86fcd9c..ca808a5 100644 --- a/src/lib/server/barcode.ts +++ b/src/lib/server/barcode.ts @@ -5,10 +5,10 @@ export async function generateBarcodeSvg(text: string): Promise { const buf = await bwipjs.toBuffer({ bcid: 'code128', text, - scale: 3, + scale: 2, height: 8, includetext: true, - textsize: 12, + textsize: 10, textxalign: 'center' }); diff --git a/src/routes/(print)/print/batch/+page.svelte b/src/routes/(print)/print/batch/+page.svelte index ec1b612..f779d51 100644 --- a/src/routes/(print)/print/batch/+page.svelte +++ b/src/routes/(print)/print/batch/+page.svelte @@ -26,7 +26,7 @@
- Setup: Brother QL-820NWB, paper "29mm x 62mm" (DK-11209), margins: top 0, bottom 0, left 2mm, right 0.5mm. + Setup: Brother QL-820NWB, paper "29mm x 62mm" (DK-11209), margins: minimum.
@@ -50,7 +50,7 @@ {/if}
- {label.shortId} + {label.shortId}
@@ -59,7 +59,7 @@