mirror of
https://github.com/tmaier/asn-qr-code-label-generator.git
synced 2026-03-14 08:33:37 +00:00
Update label format from Avery L4731REV-25 to Avery 8167
Switch from A4/European labels to US Letter size Avery 8167 labels: - Page size: A4 → US Letter (8.5" × 11") - Label size: 25.4mm × 10mm → 44.45mm × 12.7mm (1.75" × 0.5") - Grid: 7×27 (189 labels) → 4×20 (80 labels) - Margins and gaps adjusted for Avery 8167 specifications https://claude.ai/code/session_01FQAPQeBx9CFdivsHTqAGxn
This commit is contained in:
parent
b2c263c11d
commit
dcc039857c
2 changed files with 31 additions and 31 deletions
28
CLAUDE.md
28
CLAUDE.md
|
|
@ -18,29 +18,29 @@ The application uses CDN-hosted dependencies:
|
||||||
|
|
||||||
Single-page application using AlpineJS for reactivity. Key structure in `index.html`:
|
Single-page application using AlpineJS for reactivity. Key structure in `index.html`:
|
||||||
|
|
||||||
- **`qrCodeApp()`** (line 255): AlpineJS component containing all application state and logic
|
- **`qrCodeApp()`** (line 259): AlpineJS component containing all application state and logic
|
||||||
- `generateLabels()`: Creates label data array with QR code URLs via external API (api.qrserver.com)
|
- `generateLabels()`: Creates label data array with QR code URLs via external API (api.qrserver.com)
|
||||||
- `printLabels()`: Triggers browser print dialog
|
- `printLabels()`: Triggers browser print dialog
|
||||||
- Generates 189 labels per sheet (7 columns × 27 rows)
|
- Generates 80 labels per sheet (4 columns × 20 rows)
|
||||||
|
|
||||||
- **Print styling**: Uses CSS `@page` rule for A4 paper with zero margins (requires Chrome/Chromium)
|
- **Print styling**: Uses CSS `@page` rule for US Letter paper with zero margins (requires Chrome/Chromium)
|
||||||
|
|
||||||
- **Label format**: Hardcoded for Avery L4731REV-25 labels (see specifications below)
|
- **Label format**: Hardcoded for Avery 8167 labels (see specifications below)
|
||||||
|
|
||||||
## Avery L4731REV-25 Label Specifications
|
## Avery 8167 Label Specifications
|
||||||
|
|
||||||
Page: A4 (210mm × 297mm)
|
Page: US Letter (8.5" × 11" / 215.9mm × 279.4mm)
|
||||||
|
|
||||||
| Dimension | Value |
|
| Dimension | Value |
|
||||||
|-----------|-------|
|
|-----------|-------|
|
||||||
| Label size | 25.4mm × 10mm |
|
| Label size | 1.75" × 0.5" (44.45mm × 12.7mm) |
|
||||||
| Grid | 7 columns × 27 rows (189 labels) |
|
| Grid | 4 columns × 20 rows (80 labels) |
|
||||||
| Top/Bottom margin | 13.5mm |
|
| Top/Bottom margin | 0.5" (12.7mm) |
|
||||||
| Left/Right margin | 8.6mm |
|
| Left/Right margin | 0.3" (7.62mm) |
|
||||||
| Horizontal gap | 2.5mm |
|
| Horizontal gap | 0.3" (7.62mm) |
|
||||||
| Vertical gap | 0mm (labels touch) |
|
| Vertical gap | 0" (labels touch) |
|
||||||
| Horizontal pitch | 27.9mm |
|
| Horizontal pitch | 2.05" (52.07mm) |
|
||||||
| Vertical pitch | 10mm |
|
| Vertical pitch | 0.5" (12.7mm) |
|
||||||
|
|
||||||
## Code Style
|
## Code Style
|
||||||
|
|
||||||
|
|
|
||||||
34
index.html
34
index.html
|
|
@ -19,7 +19,7 @@
|
||||||
@page {
|
@page {
|
||||||
/* Remove default margin set by the browser */
|
/* Remove default margin set by the browser */
|
||||||
margin: 0mm;
|
margin: 0mm;
|
||||||
size: A4;
|
size: Letter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
@ -56,8 +56,8 @@
|
||||||
<p>
|
<p>
|
||||||
This tool generates QR code labels for the
|
This tool generates QR code labels for the
|
||||||
<abbr title="Archive Serial Number">ASN</abbr> feature. You can
|
<abbr title="Archive Serial Number">ASN</abbr> feature. You can
|
||||||
generate labels for up to 189 documents at once. The labels are
|
generate labels for up to 80 documents at once. The labels are
|
||||||
formatted to <strong>fit on Avery L4731REV-25 labels</strong>.
|
formatted to <strong>fit on Avery 8167 labels</strong> (US Letter size).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|
@ -100,12 +100,12 @@
|
||||||
<p
|
<p
|
||||||
class="prose prose-sm prose-a:text-blue-600 prose-a:underline hover:prose-a:text-blue-700 max-w-none"
|
class="prose prose-sm prose-a:text-blue-600 prose-a:underline hover:prose-a:text-blue-700 max-w-none"
|
||||||
>
|
>
|
||||||
The number of labels generated will be 7 x 27 = 189. This means
|
The number of labels generated will be 4 x 20 = 80. This means
|
||||||
the <strong>next batch</strong> of labels should
|
the <strong>next batch</strong> of labels should
|
||||||
<strong
|
<strong
|
||||||
>start with
|
>start with
|
||||||
<span x-text="parseInt(startNumber, 10) + 189"
|
<span x-text="parseInt(startNumber, 10) + 80"
|
||||||
>190</span
|
>81</span
|
||||||
></strong
|
></strong
|
||||||
>.
|
>.
|
||||||
</p>
|
</p>
|
||||||
|
|
@ -198,14 +198,14 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="container mx-auto w-[210mm] border px-[8.6mm] py-[13.5mm] print:w-full print:max-w-full print:border-0"
|
class="container mx-auto w-[215.9mm] border px-[7.62mm] py-[12.7mm] print:w-full print:max-w-full print:border-0"
|
||||||
>
|
>
|
||||||
<!-- Display QR Code Labels -->
|
<!-- Display QR Code Labels -->
|
||||||
<ol class="grid grid-cols-7 gap-x-[2.5mm]">
|
<ol class="grid grid-cols-4 gap-x-[7.62mm]">
|
||||||
<template x-for="label in labels">
|
<template x-for="label in labels">
|
||||||
<li class="h-[10mm] w-[25.4mm]">
|
<li class="h-[12.7mm] w-[44.45mm]">
|
||||||
<div
|
<div
|
||||||
class="flex h-[9mm] w-[24.4mm] items-center border-[0.5mm] odd:border-blue-500 even:border-red-300"
|
class="flex h-[11.7mm] w-[43.45mm] items-center border-[0.5mm] odd:border-blue-500 even:border-red-300"
|
||||||
:class="{'even:border-transparent odd:border-transparent': !borderToggle}"
|
:class="{'even:border-transparent odd:border-transparent': !borderToggle}"
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
|
|
@ -213,17 +213,17 @@
|
||||||
alt=""
|
alt=""
|
||||||
width="100"
|
width="100"
|
||||||
height="100"
|
height="100"
|
||||||
class="mr-[0.5mm] aspect-square h-[9mm] w-[9mm] flex-none"
|
class="mr-[1mm] aspect-square h-[11mm] w-[11mm] flex-none"
|
||||||
referrerpolicy="no-referrer"
|
referrerpolicy="no-referrer"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
class="flex-grow"
|
class="flex-grow"
|
||||||
:class="{
|
:class="{
|
||||||
'text-[3.9mm]': label.text.length <= 6,
|
'text-[4.5mm]': label.text.length <= 6,
|
||||||
'text-[3.2mm]': label.text.length == 7,
|
'text-[4mm]': label.text.length == 7,
|
||||||
'text-[2.7mm]': label.text.length == 8,
|
'text-[3.5mm]': label.text.length == 8,
|
||||||
'text-[2.4mm]': label.text.length == 9,
|
'text-[3mm]': label.text.length == 9,
|
||||||
'text-[2.1mm]': label.text.length >= 10,
|
'text-[2.5mm]': label.text.length >= 10,
|
||||||
}"
|
}"
|
||||||
x-text="label.text"
|
x-text="label.text"
|
||||||
></div>
|
></div>
|
||||||
|
|
@ -294,7 +294,7 @@
|
||||||
|
|
||||||
generateLabels() {
|
generateLabels() {
|
||||||
this.labels = [];
|
this.labels = [];
|
||||||
let totalLabels = 7 * 27; // 7 columns x 27 rows
|
let totalLabels = 4 * 20; // 4 columns x 20 rows
|
||||||
let startNumberInt = parseInt(this.startNumber, 10); // Ensure startNumber is an integer
|
let startNumberInt = parseInt(this.startNumber, 10); // Ensure startNumber is an integer
|
||||||
let leadingZerosInt = parseInt(this.leadingZeros, 10); // Ensure leadingZeros is an integer
|
let leadingZerosInt = parseInt(this.leadingZeros, 10); // Ensure leadingZeros is an integer
|
||||||
for (let i = 0; i < totalLabels; i++) {
|
for (let i = 0; i < totalLabels; i++) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue