Files
adaptronic_label-printer/old_code/PRINT_QUALITY_IMPROVEMENTS.md
NAME 6a11cf3d8d Clean repository and update .gitignore
- 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
2026-02-13 23:41:34 +02:00

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.LANCZOS with 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:

  1. Print Quality: Highest/Best (600 DPI or higher)
  2. Darkness/Intensity: Medium to High (adjust based on label material)
  3. Print Speed: Medium to Slow (slower = better quality)
  4. Dithering: None/Off (for sharp text and barcodes)
  5. Graphics Mode: Vector or High Quality
  6. Paper Type: Label/Thermal (match your label stock)

How to Configure Windows Printer Settings

  1. Open Windows SettingsDevicesPrinters & scanners
  2. Click on your Labels printer
  3. Click ManagePrinting preferences
  4. 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
  5. Click Apply and OK

🔧 Troubleshooting

If print quality is still poor:

  1. Run the printer quality check:

    .\check_printer_quality.ps1
    
  2. Check label material:

    • Direct thermal labels need heat-sensitive coating
    • Thermal transfer labels need ribbon cartridge
    • Wrong label type = poor quality
  3. Verify printer driver:

    • Update to latest driver from manufacturer's website
    • Some generic drivers don't support high-quality settings
  4. Test print from printer:

    • Print a self-test page from the printer
    • This verifies printer hardware is functioning correctly
  5. Check printhead:

    • Dirty printhead = streaky output
    • Clean printhead with isopropyl alcohol and cleaning cards
  6. 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:

  1. Print a test label with all three fields filled
  2. Check text readability: Should be crisp and clear
  3. 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:

  1. print_label_pdf.py - 5 changes
  2. print_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:

  1. Verify printer model and capabilities
  2. Check printer firmware version
  3. Test with different label stock
  4. Contact printer manufacturer support with sample outputs

Last Updated: February 13, 2026
Version: 2.0 - Quality Enhancement Release