- Remove build artifacts from git tracking (build/, dist/, __pycache__/, *.spec) - Updated .gitignore to properly exclude generated files - Added old_code/ documentation folder - Updated sample_data.txt to show new 5-field format - Exclude user-specific conf/app.conf from tracking
5.5 KiB
5.5 KiB
Simple Label Printer Setup Guide
🎯 The Correct Workflow
How It Works:
- GUI monitors text file for changes (
C:\Users\Public\Documents\check.txt) - When file changes, reads data:
COMANDA;NR_ART;SERIAL - Replaces variables in SVG template (
conf/label_template.svg):{Article}→ COMANDA value{NrArt}→ NR_ART value{Serial}→ SERIAL value
- Converts SVG → PDF at exact 35mm x 25mm size
- Prints PDF to configured printer
- Saves backup in
pdf_backup/folder
Template Customization:
- Edit
conf/label_template.svgto change label layout - Move text positions, add graphics, change fonts
- Keep placeholders:
{Article},{NrArt},{Serial} - No code changes needed!
🚀 ONE-TIME Setup (5 Minutes)
Step 1: Configure Printer (REQUIRED)
.\setup_printer.ps1
What this does:
- Opens printer preferences dialog
- Guides you to set:
- Paper Size: 35mm x 25mm (custom)
- Orientation: Landscape
- Quality: BEST/600 DPI
- Tests printing
This is CRITICAL - without correct paper size, you'll get:
- ❌ 1 meter roll printing
- ❌ Wrong label size
- ❌ Portrait instead of landscape
✅ Daily Use
Start the Application:
python label_printer_gui.py
What You'll See:
- GUI opens with monitoring controls
- Select printer: "Labels"
- Click "Start Monitoring" (or auto-starts)
- GUI watches the file for changes
Trigger Printing:
- Application writes to
C:\Users\Public\Documents\check.txt - Format:
COM-2024-002;ART-67890;SN-20260212 - GUI detects change → Prints label automatically
- File is cleared after printing
📝 Data Format
Input File: check.txt
COM-2024-002;ART-67890;SN-20260212
Separator: Semicolon (;)
Breakdown:
- Field 1: Nr. Comanda (Order Number)
- Field 2: Nr. Art. (Article Number)
- Field 3: Serial No. (Serial Number)
Example Data:
ORDER-123;PART-456;SN-2026-001
COM-2024-100;ART-55555;SERIAL-123456
COMANDA-X;ARTICLE-Y;SN-Z
All fields are printed on the label as entered.
🔧 Troubleshooting
Problem: 1 Meter Roll Printing
Cause: Printer paper size not configured Fix:
.\setup_printer.ps1
Set paper size to 35mm x 25mm custom
Problem: Dotted/Pixelated Text
Cause: Print quality too low Fix:
- Open printer preferences
- Set quality to BEST or 600 DPI
- Disable dithering
4.Run
.\setup_printer.ps1again
Problem: Label Wrong Orientation
Cause: Orientation not set to landscape Fix:
- Open printer preferences
- Set orientation to LANDSCAPE
- Save and test
Problem: Template Not Working
Cause: SVG template issues Check:
# Verify template exists
dir conf\label_template.svg
# Check console for errors when printing
# Should see: "Using SVG template: conf\label_template.svg"
Problem: Variables Not Replaced
Cause: Template placeholders wrong Fix:
- Open
conf\label_template.svg - Verify placeholders are exactly:
{Article}{NrArt}{Serial}
- Case-sensitive!
📊 Quality Settings Summary
| Setting | Value | Why |
|---|---|---|
| PDF DPI | 1200 | Sharp text & images |
| Paper Size | 35mm x 25mm | Correct label size |
| Orientation | Landscape | Horizontal layout |
| Print Quality | 600+ DPI | No dotted text |
| Font Size | 8pt | Readable at 35mm width |
| Compression | Disabled | No quality loss |
📁 Important Files
| File | Purpose |
|---|---|
label_printer_gui.py |
Main GUI application |
conf/label_template.svg |
Label layout template |
conf/accepted.png |
Checkmark image |
pdf_backup/ |
PDF backups of all labels |
logs/ |
Print history logs |
C:\Users\Public\Documents\check.txt |
Monitored input file |
🎨 Customizing Label Layout
Edit the Template:
-
Open
conf\label_template.svgin:- Inkscape (free SVG editor)
- Adobe Illustrator
- Any SVG editor
-
Modify:
- Text positions
- Font sizes/colors
- Add graphics/logos
- Change layout
-
Keep placeholders:
<text>{Article}</text> <text>{NrArt}</text> <text>{Serial}</text> -
Save as 35mm x 25mm document
-
Test:
python test_quality.py
No code changes needed! Template is reloaded each time.
✅ Verification Checklist
After setup, verify:
- Printer configured (35mm x 25mm, landscape, high quality)
- Test label prints correctly (one label, right size)
- Text is sharp (not dotted)
- GUI starts without errors
- Monitoring detects file changes
- Variables are replaced in output
- PDF backup is created
- Log entry is saved
If all checked ✅ → System working correctly!
🆘 Quick Reference Commands
# Initial setup
.\setup_printer.ps1
# Start application
python label_printer_gui.py
# Test print
python test_quality.py
# Check printer config
.\configure_printer_quality.ps1
# View latest PDF
cd pdf_backup
ls | sort LastWriteTime | select -last 1
📞 Support
If problems persist:
- Check printer driver: Update from manufacturer website
- Verify label stock: Correct thermal labels loaded
- Test printer: Print self-test page
- Review logs: Check
logs/print_log_*.csv - Check PDFs: Open latest PDF in
pdf_backup/to verify content
Version: 3.0 - Simplified & Fixed
Last Updated: February 13, 2026
Status: ✅ Ready for Production