- Created label_printer_gui.py: Complete Kivy-based GUI application - Two-column layout (input form + live preview) - SAP-Nr, Quantity, Cable ID input fields - Real-time barcode preview (11.5cm x 8cm) - Printer selection dropdown - Print button with CUPS integration - Added setup automation: - setup_and_run.py: Python setup launcher - start_gui.sh: Bash launcher script - validate_project.py: Project validation - Added comprehensive documentation: - INDEX.md: Project overview and quick start - GETTING_STARTED.md: 15-minute quick start guide - README_GUI.md: Complete feature documentation - TECHNICAL_DOCS.md: Architecture and customization - FILE_GUIDE.md: File reference guide - IMPLEMENTATION_SUMMARY.md: Implementation overview - Updated dependencies: - requirements_gui.txt: New Kivy dependencies - Preserved: - print_label.py: Original printing engine (modified to remove main code) - Original documentation and dependencies Features: - Live preview of labels as you type - Automatic CUPS printer detection - Non-blocking background printing - User-friendly error handling - Responsive two-column layout - Production-ready quality
5.8 KiB
5.8 KiB
Getting Started with Label Printer GUI
Overview
Your Label Printer application now has a modern Kivy-based GUI interface! This guide will help you get started.
Quick Start (3 Steps)
Option 1: Python Script (Recommended)
python3 setup_and_run.py
This handles everything - checks dependencies, installs packages, and starts the GUI.
Option 2: Bash Script
chmod +x start_gui.sh
./start_gui.sh
Option 3: Manual
pip install -r requirements_gui.txt
python3 label_printer_gui.py
What You'll See
Main Window Layout
┌─────────────────────────────────────────────────────────────┐
│ Label Printer Interface │
├──────────────────┬──────────────────────────────────────────┤
│ Input Column │ Preview Column │
│ (40%) │ (60%) │
│ │ │
│ ✓ SAP-Nr. Input │ ╔════════════════════╗ │
│ [________] │ ║ Live Preview ║ │
│ │ ║ 11.5cm x 8cm ║ │
│ ✓ Quantity │ ║ ║ │
│ [________] │ ║ [Barcode] ║ │
│ │ ║ SAP | QTY | ID ║ │
│ ✓ Cable ID │ ║ ║ │
│ [________] │ ╚════════════════════╝ │
│ │ │
│ ✓ Printer ▼ │ │
│ [PDF ▼] │ │
│ │ │
│ [PRINT LABEL] │ │
│ │ │
└──────────────────┴──────────────────────────────────────────┘
Features Explained
Left Column - Data Entry
-
SAP-Nr. Articol
- Enter the SAP article number or identifier
- Example:
A012345 - Updates preview automatically
-
Cantitate (Quantity)
- Numbers only
- Example:
100 - Numeric input only
-
ID rola cablu (Cable Reel ID)
- Cable reel identifier
- Example:
REEL-001 - Updates preview automatically
-
Printer Selection
- Dropdown menu with available system printers
- Shows all CUPS-configured printers
- Default: PDF printer (if no others available)
-
Print Label Button
- Green button at bottom
- Triggers printing to selected printer
- Shows status notifications
Right Column - Live Preview
- Shows exactly what will print
- Updates in real-time as you type
- Label dimensions: 11.5 cm × 8 cm
- Displays:
- Barcode (Code128 format)
- SAP number, quantity, and cable ID combined
- High quality 300 DPI rendering
Workflow Example
-
Start the application:
python3 setup_and_run.py -
Enter data:
- SAP-Nr:
A456789 - Cantitate:
50 - ID rola cablu:
REEL-042
- SAP-Nr:
-
Check preview (automatically updates on right)
-
Select printer (use dropdown)
-
Click PRINT LABEL button
-
Confirm when notification appears
Printer Setup
Check Available Printers
lpstat -p -d
Add a Printer (if needed)
# Use CUPS web interface
http://localhost:631
Common Printer Names
PDF- Virtual PDF printer (for testing)Brother_HL_L2350DW- Brother laser printerCanon_PIXMA- Canon printer- Check your system for exact name
Troubleshooting
"No Printers Found"
# Start CUPS service
sudo systemctl start cups
# Check status
sudo systemctl status cups
# List printers
lpstat -p -d
Preview Not Updating
- Check Python console for errors
- Verify all dependencies installed:
pip list | grep -E 'kivy|barcode|pillow' - Try restarting the application
Print Fails
# Test print command manually
echo "test" | lp -d PDF
# Check printer status
lpstat -p -l
Kivy Window Issues
- If window doesn't open, check X11 display:
echo $DISPLAY - Resize window manually if elements overlap
File Guide
- label_printer_gui.py - Main GUI application
- print_label.py - Core printing functions
- setup_and_run.py - Automatic setup script
- start_gui.sh - Bash launcher script
- requirements_gui.txt - Python dependencies
- README_GUI.md - Complete documentation
Tips & Tricks
-
Fast Printing:
- Preset SAP number as most common value
- Just change quantity/ID for each label
-
Batch Printing:
- Print one label at a time
- Small UI makes it quick
-
Testing:
- Use "PDF" printer to save test labels
- Check output files to verify format
-
Keyboard:
- Tab between fields
- Enter in printer dropdown to confirm selection
- Alt+P might activate Print button (Kivy dependent)
Next Steps
- Learn More: See README_GUI.md
- Customize: Modify
label_printer_gui.pyfor your needs - Integrate: Use functions in other Python applications
- Support: Check console output for detailed error messages
Ready to print? Start with: python3 setup_and_run.py