Label: large ID below barcode (9pt, same as title), left-align text
Deploy to LXC / deploy (push) Successful in 19s
Deploy to LXC / deploy (push) Successful in 19s
- Barcode rendered without embedded text (includetext: false) - ID rendered as separate HTML text at 9pt bold with letter-spacing - All label text left-aligned instead of centred - Barcode height reduced to 5mm to fit Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -7,8 +7,7 @@ export async function generateBarcodeSvg(text: string): Promise<string> {
|
||||
text,
|
||||
scale: 2,
|
||||
height: 8,
|
||||
includetext: true,
|
||||
textsize: 10,
|
||||
includetext: false,
|
||||
textxalign: 'center'
|
||||
});
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
</svelte:head>
|
||||
|
||||
<div class="no-print" style="max-width: 500px; margin: 20px auto; font-family: system-ui, sans-serif;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px;">
|
||||
<a href="/batch-print" style="color: #2563eb; font-size: 14px;">← Back</a>
|
||||
<button onclick={() => window.print()}
|
||||
style="background: #2563eb; color: white; border: none; padding: 8px 16px; border-radius: 6px; font-size: 14px; cursor: pointer;">
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
{#each data.labels as label}
|
||||
<div class="label" style="width: 62mm; height: 29mm; background: white; color: black; box-sizing: border-box; padding: 1mm; margin: 0 auto 8px auto; border: 1px dashed #ccc; overflow: hidden;">
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; font-family: 'JetBrains Mono', monospace; text-align: center;">
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: flex-start; height: 100%; font-family: 'JetBrains Mono', monospace; text-align: left;">
|
||||
<div style="font-size: 9pt; font-weight: bold; color: #000; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;">
|
||||
{label.title}
|
||||
</div>
|
||||
@@ -50,7 +50,10 @@
|
||||
</div>
|
||||
{/if}
|
||||
<div style="margin-top: 0.5mm;">
|
||||
<img src={label.barcodeDataUrl} alt={label.shortId} style="height: 6mm; width: auto; max-width: 56mm;" />
|
||||
<img src={label.barcodeDataUrl} alt={label.shortId} style="height: 5mm; width: auto; max-width: 56mm;" />
|
||||
</div>
|
||||
<div style="font-size: 9pt; font-weight: bold; color: #000; letter-spacing: 1.5px; margin-top: 0.3mm;">
|
||||
{label.shortId}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</svelte:head>
|
||||
|
||||
<div class="no-print" style="max-width: 500px; margin: 20px auto; font-family: system-ui, sans-serif;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px;">
|
||||
<a href="/components/{data.component.id}" style="color: #2563eb; font-size: 14px;">← Back</a>
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<div style="display: flex; align-items: flex-start; gap: 12px;">
|
||||
<label style="font-size: 14px; color: #666;">
|
||||
Copies:
|
||||
<input type="number" bind:value={copies} min="1" max="20"
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
{#each Array(copies) as _}
|
||||
<div class="label" style="width: 62mm; height: 29mm; background: white; color: black; box-sizing: border-box; padding: 1mm; margin: 0 auto 8px auto; border: 1px dashed #ccc; overflow: hidden;">
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; font-family: 'JetBrains Mono', monospace; text-align: center;">
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: flex-start; height: 100%; font-family: 'JetBrains Mono', monospace; text-align: left;">
|
||||
<div style="font-size: 9pt; font-weight: bold; color: #000; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;">
|
||||
{data.component.title}
|
||||
</div>
|
||||
@@ -52,7 +52,10 @@
|
||||
<div style="font-size: 5pt; color: #666;">P/N: {data.component.partNumber}</div>
|
||||
{/if}
|
||||
<div style="margin-top: 0.5mm;">
|
||||
<img src={data.barcodeDataUrl} alt={data.shortId} style="height: 6mm; width: auto; max-width: 56mm;" />
|
||||
<img src={data.barcodeDataUrl} alt={data.shortId} style="height: 5mm; width: auto; max-width: 56mm;" />
|
||||
</div>
|
||||
<div style="font-size: 9pt; font-weight: bold; color: #000; letter-spacing: 1.5px; margin-top: 0.3mm;">
|
||||
{data.shortId}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -19,9 +19,9 @@
|
||||
</svelte:head>
|
||||
|
||||
<div class="no-print" style="max-width: 500px; margin: 20px auto; font-family: system-ui, sans-serif;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px;">
|
||||
<div style="display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 16px;">
|
||||
<a href="/devices/{data.device.id}" style="color: #2563eb; font-size: 14px;">← Back</a>
|
||||
<div style="display: flex; align-items: center; gap: 12px;">
|
||||
<div style="display: flex; align-items: flex-start; gap: 12px;">
|
||||
<label style="font-size: 14px; color: #666;">
|
||||
Copies:
|
||||
<input type="number" bind:value={copies} min="1" max="20"
|
||||
@@ -40,7 +40,7 @@
|
||||
|
||||
{#each Array(copies) as _}
|
||||
<div class="label" style="width: 62mm; height: 29mm; background: white; color: black; box-sizing: border-box; padding: 1mm; margin: 0 auto 8px auto; border: 1px dashed #ccc; overflow: hidden;">
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: center; height: 100%; font-family: 'JetBrains Mono', monospace; text-align: center;">
|
||||
<div style="display: flex; flex-direction: column; justify-content: center; align-items: flex-start; height: 100%; font-family: 'JetBrains Mono', monospace; text-align: left;">
|
||||
<div style="font-size: 9pt; font-weight: bold; color: #000; line-height: 1.1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%;">
|
||||
{data.device.title}
|
||||
</div>
|
||||
@@ -58,7 +58,10 @@
|
||||
</div>
|
||||
{/if}
|
||||
<div style="margin-top: 0.5mm;">
|
||||
<img src={data.barcodeDataUrl} alt={data.shortId} style="height: 6mm; width: auto; max-width: 56mm;" />
|
||||
<img src={data.barcodeDataUrl} alt={data.shortId} style="height: 5mm; width: auto; max-width: 56mm;" />
|
||||
</div>
|
||||
<div style="font-size: 9pt; font-weight: bold; color: #000; letter-spacing: 1.5px; margin-top: 0.3mm;">
|
||||
{data.shortId}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user