- 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.2 KiB
5.2 KiB
Print Quality Improvements - Label Printer
Summary of Changes
This document outlines the comprehensive print quality improvements made to enhance label output quality, particularly for thermal label printers.
🎯 Key Improvements
1. Increased DPI Resolution
- Before: 600 DPI
- After: 1200 DPI
- Impact: Significantly sharper text and images, especially on thermal printers
- Changed in:
print_label_pdf.py- PDFLabelGenerator class
2. Enhanced Font Size
- Before: 6pt font (~2.1mm height)
- After: 8pt font (~2.8mm height)
- Impact: Better readability, especially for serial numbers and part numbers
- Changed in:
print_label_pdf.py- create_label_pdf() method
3. Disabled PDF Compression
- Before: Compression enabled (level 1)
- After: Compression disabled (level 0)
- Impact: No quality loss from compression artifacts
- Changed in:
print_label_pdf.py- create_label_pdf() method
4. Improved Image Quality
- Before: Converted images to grayscale ('L' mode)
- After: Keep images in RGB mode with DPI metadata
- Impact: Better image quality; thermal printers will handle color→BW conversion optimally
- Changed in:
print_label_pdf.py- load_image() and create_label_pdf() methods
5. Fixed Image Resampling
- Before: Used deprecated
Image.LANCZOS - After: Uses
Image.Resampling.LANCZOSwith fallback - Impact: Compatible with newer Pillow versions, maintains quality
- Changed in:
print_label.py- create_label_image() method
6. Improved SumatraPDF Print Settings
- Before:
noscale,landscape - After:
noscale,landscape,fit - Impact: Ensures content fits page properly without clipping
- Changed in:
print_label.py- print_to_printer() method
📋 Additional Recommendations
Printer Settings Configuration
For optimal print quality, ensure your thermal printer is configured with:
- Print Quality: Highest/Best (600 DPI or higher)
- Darkness/Intensity: Medium to High (adjust based on label material)
- Print Speed: Medium to Slow (slower = better quality)
- Dithering: None/Off (for sharp text and barcodes)
- Graphics Mode: Vector or High Quality
- Paper Type: Label/Thermal (match your label stock)
How to Configure Windows Printer Settings
- Open Windows Settings → Devices → Printers & scanners
- Click on your Labels printer
- Click Manage → Printing preferences
- Look for these settings:
- Quality tab: Set to highest DPI available
- Advanced tab: Check for density/darkness settings
- Graphics tab: Disable dithering, enable vector mode
- Click Apply and OK
🔧 Troubleshooting
If print quality is still poor:
-
Run the printer quality check:
.\check_printer_quality.ps1 -
Check label material:
- Direct thermal labels need heat-sensitive coating
- Thermal transfer labels need ribbon cartridge
- Wrong label type = poor quality
-
Verify printer driver:
- Update to latest driver from manufacturer's website
- Some generic drivers don't support high-quality settings
-
Test print from printer:
- Print a self-test page from the printer
- This verifies printer hardware is functioning correctly
-
Check printhead:
- Dirty printhead = streaky output
- Clean printhead with isopropyl alcohol and cleaning cards
-
Adjust print darkness:
- Too light: Increase darkness/temperature
- Too dark: Decrease darkness/temperature
- Adjust in printer preferences or physical dial
📊 Quality Comparison
| Aspect | Before | After | Improvement |
|---|---|---|---|
| DPI | 600 | 1200 | +100% |
| Font Size | 6pt | 8pt | +33% |
| Image Mode | Grayscale | RGB | Better quality |
| PDF Compression | Enabled | Disabled | No artifacts |
| Image Resampling | Deprecated API | Modern API | Better compatibility |
🧪 Testing
To verify improvements:
- Print a test label with all three fields filled
- Check text readability: Should be crisp and clear
- Inspect image: Should have clean edges without jaggedness
Expected results:
- ✅ Text is sharp and readable at arm's length
- ✅ Images (accepted/refused checkmark) are crisp
- ✅ No pixelation or compression artifacts visible
📝 Code Changes Summary
Files Modified:
print_label_pdf.py- 5 changesprint_label.py- 2 changes (image resampling + print settings)
Backward Compatibility:
- ✅ All changes are backward compatible
- ✅ No breaking changes to API
- ✅ Fallback for older Pillow versions included
🔄 Rollback Instructions
If you need to revert changes:
git checkout HEAD~1 print_label_pdf.py print_label.py
Or manually adjust these values back in the files:
- DPI: 1200 → 600
- Font size: 8 → 6
- Compression: 0 → 1
📞 Support
If print quality issues persist after these changes:
- Verify printer model and capabilities
- Check printer firmware version
- Test with different label stock
- Contact printer manufacturer support with sample outputs
Last Updated: February 13, 2026
Version: 2.0 - Quality Enhancement Release