Fix printing: landscape orientation + high quality DPI via win32print before SumatraPDF job
This commit is contained in:
@@ -48,6 +48,17 @@ if errorlevel 1 (
|
||||
)
|
||||
echo.
|
||||
|
||||
REM Check that SumatraPDF.exe exists before building
|
||||
if not exist "conf\SumatraPDF.exe" (
|
||||
echo ERROR: conf\SumatraPDF.exe not found!
|
||||
echo Please download SumatraPDF portable exe and place it at conf\SumatraPDF.exe
|
||||
echo Download from: https://www.sumatrapdfreader.org/download-free-pdf-viewer
|
||||
pause
|
||||
exit /b 1
|
||||
)
|
||||
echo conf\SumatraPDF.exe found - will be bundled into executable.
|
||||
echo.
|
||||
|
||||
REM Clean old build
|
||||
echo [4/5] Cleaning old build artifacts...
|
||||
if exist "dist" rmdir /s /q dist
|
||||
@@ -79,6 +90,11 @@ pyinstaller label_printer_gui.py ^
|
||||
--hidden-import=watchdog.events ^
|
||||
--hidden-import=pystray ^
|
||||
--hidden-import=win32timezone ^
|
||||
--add-data "conf\SumatraPDF.exe;." ^
|
||||
--add-data "conf\SumatraPDF-settings.txt;conf" ^
|
||||
--add-data "conf\label_template_ok.svg;conf" ^
|
||||
--add-data "conf\label_template_nok.svg;conf" ^
|
||||
--add-data "conf\label_template.svg;conf" ^
|
||||
-y
|
||||
|
||||
if errorlevel 1 (
|
||||
@@ -94,12 +110,26 @@ echo ========================================================
|
||||
echo BUILD SUCCESSFUL!
|
||||
echo ========================================================
|
||||
echo.
|
||||
echo Copying conf folder to dist\conf ...
|
||||
if exist dist\conf rmdir /s /q dist\conf
|
||||
xcopy /e /i /q conf dist\conf
|
||||
if errorlevel 1 (
|
||||
echo WARNING: Could not copy conf folder to dist\conf
|
||||
echo You must manually copy the conf folder next to LabelPrinter.exe before deployment.
|
||||
) else (
|
||||
echo conf folder copied to dist\conf successfully.
|
||||
)
|
||||
echo.
|
||||
echo Executable Location: dist\LabelPrinter.exe
|
||||
echo.
|
||||
echo Deployment folder contents:
|
||||
dir dist
|
||||
echo.
|
||||
echo Next steps:
|
||||
echo 1. Navigate to the dist folder
|
||||
echo 2. Double-click LabelPrinter.exe to run
|
||||
echo 3. You can copy LabelPrinter.exe to other machines
|
||||
echo 1. Copy the entire dist\ folder to the target machine
|
||||
echo (it contains LabelPrinter.exe AND the conf\ folder)
|
||||
echo 2. Run LabelPrinter.exe from the dist folder
|
||||
echo 3. Ensure conf\SumatraPDF.exe is present for printing to work
|
||||
echo.
|
||||
echo Note: First run may take a moment as Kivy initializes
|
||||
echo.
|
||||
|
||||
Reference in New Issue
Block a user