Files
adaptronic_label-printer/old_code/setup_printer.ps1
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

129 lines
6.1 KiB
PowerShell

# Manual Label Printer Setup - 35mm x 25mm Labels
# Optimized for: Citizen CTS-310, Zebra ZD420, Zebra ZD421
# Run this script ONCE to configure your printer correctly
$printerName = "Labels"
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " THERMAL LABEL PRINTER CONFIGURATION" -ForegroundColor Cyan
Write-Host " Citizen CTS-310 / Zebra ZD420/ZD421" -ForegroundColor Cyan
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
# Step 1: Open Printer Preferences
Write-Host "STEP 1: Configure Label Size & Print Settings" -ForegroundColor Yellow
Write-Host ""
Write-Host "We will open the printer preferences dialog." -ForegroundColor White
Write-Host "You MUST configure these settings:" -ForegroundColor Red
Write-Host ""
Write-Host " [x] Media/Paper Type: LABELS (not continuous/receipt)" -ForegroundColor Green
Write-Host ""
Write-Host " [x] Label Size: 35mm x 25mm" -ForegroundColor Green
Write-Host " Common names in driver:" -ForegroundColor Gray
Write-Host " - '35mm x 25mm'" -ForegroundColor Gray
Write-Host " - '1.38in x 0.98in'" -ForegroundColor Gray
Write-Host " - 'Custom' -> Width: 35mm, Height: 25mm" -ForegroundColor Gray
Write-Host ""
Write-Host " [x] Orientation: LANDSCAPE (35mm wide, 25mm tall)" -ForegroundColor Green
Write-Host ""
Write-Host " [x] Print Mode: THERMAL DIRECT or THERMAL TRANSFER" -ForegroundColor Green
Write-Host " - Match your label stock type" -ForegroundColor Gray
Write-Host ""
Write-Host " [x] Print Density/Darkness: 10-15 (medium)" -ForegroundColor Green
Write-Host " - Zebra: 10-15 on scale of 0-30" -ForegroundColor Gray
Write-Host " - Citizen: Medium darkness setting" -ForegroundColor Gray
Write-Host " - Adjust if too light/dark after test" -ForegroundColor Gray
Write-Host ""
Write-Host " [x] Print Speed: Medium (4-6 inches/sec)" -ForegroundColor Green
Write-Host " - Slower = better quality" -ForegroundColor Gray
Write-Host ""
Write-Host " [x] Print Quality/Resolution: 203 DPI or 300 DPI" -ForegroundColor Green
Write-Host " - Use highest available (203 or 300)" -ForegroundColor Gray
Write-Host " - NOT draft mode" -ForegroundColor Gray
Write-Host ""
Write-Host "Press Enter to open printer preferences..." -ForegroundColor Yellow
Read-Host
# Open Printer Preferences
Write-Host "Opening printer preferences dialog..." -ForegroundColor Cyan
Start-Process "rundll32" -ArgumentList "printui.dll,PrintUIEntry /e /n$printerName" -Wait:$false
Write-Host ""
Write-Host "After configuring the printer:" -ForegroundColor Yellow
Write-Host "1. Click OK/Apply to save settings" -ForegroundColor White
Write-Host "2. Close all printer dialogs" -ForegroundColor White
Write-Host "3. Return here and press Enter" -ForegroundColor White
Write-Host ""
Read-Host "Press Enter when you've configured the printer"
# Step 2: Test Print
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " STEP 2: Test Print" -ForegroundColor Yellow
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
$testPrint = Read-Host "Would you like to print a test label now? (Y/N)"
if ($testPrint -eq 'Y' -or $testPrint -eq 'y') {
Write-Host ""
Write-Host "Generating test label..." -ForegroundColor Cyan
# Check if test script exists
if (Test-Path "test_quality.py") {
& python test_quality.py
Write-Host ""
Write-Host "Check the printed label:" -ForegroundColor Yellow
Write-Host " [?] Is it 35mm x 25mm (about business card size)?" -ForegroundColor White
Write-Host " [?] Is the text sharp and clear (not dotted)?" -ForegroundColor White
Write-Host " [?] Is the orientation correct (landscape)?" -ForegroundColor White
Write-Host ""
$result = Read-Host "Did the test print correctly? (Y/N)"
if ($result -eq 'Y' -or $result -eq 'y') {
Write-Host ""
Write-Host "SUCCESS! Printer is configured correctly." -ForegroundColor Green
Write-Host "You can now use the label printer application." -ForegroundColor Green
} else {
Write-Host ""
Write-Host "Test failed. Common issues:" -ForegroundColor Red
Write-Host " - Wrong size? Check Media Type is set to LABELS (not Continuous)" -ForegroundColor Yellow
Write-Host " - Dotted text? Increase darkness to 12-15" -ForegroundColor Yellow
Write-Host " - Too dark? Decrease darkness to 8-10" -ForegroundColor Yellow
Write-Host " - Wrong orientation? Change to LANDSCAPE" -ForegroundColor Yellow
Write-Host ""
Write-Host "Re-run this script to try again." -ForegroundColor White
}
} else {
Write-Host ""
Write-Host "test_quality.py not found. Creating simple test..." -ForegroundColor Yellow
# Create a simple test file
$testData = "TEST;12345;SN001"
Set-Content -Path "C:\Users\Public\Documents\check.txt" -Value $testData
Write-Host "Test data written to check.txt" -ForegroundColor Green
Write-Host "Make sure the label printer GUI is running to process it." -ForegroundColor White
}
} else {
Write-Host ""
Write-Host "Setup complete!" -ForegroundColor Green
Write-Host "Run the label printer GUI to start printing." -ForegroundColor White
}
Write-Host ""
Write-Host "========================================" -ForegroundColor Cyan
Write-Host " Configuration Notes" -ForegroundColor Yellow
Write-Host "========================================" -ForegroundColor Cyan
Write-Host ""
Write-Host "Remember:" -ForegroundColor White
Write-Host " - Media Type MUST be 'LABELS' (enables gap sensor)" -ForegroundColor Yellow
Write-Host " - This prevents continuous roll printing" -ForegroundColor Yellow
Write-Host " - Adjust darkness if text is too light/dark" -ForegroundColor Yellow
Write-Host " - These settings apply to all print jobs" -ForegroundColor Yellow
Write-Host ""
Write-Host "Press any key to exit..." -ForegroundColor Gray
Read-Host