ArchivedTools/ScanScripts/Windows/magazines/2 - Make tiff magazine.cmd

42 lines
817 B
Batchfile
Raw Permalink Normal View History

2023-12-21 01:01:29 +00:00
@echo off
setlocal EnableDelayedExpansion
set folder=%cd%
cd work\out
choice /m "Fix paging "
if %errorlevel%==1 (
copy D:\Retro-Work\correct_pages.php .\ /y
php -f correct_pages.php
cd newpages
)
if NOT EXIST output mkdir output
if NOT EXIST tablet mkdir tablet
set thumb=1
for %%i in (*.tif) DO (
if !thumb!==1 (
convert %%i -resize 240x310^^! -quality 80%% "!folder!\thumb.jpg"
)
set thumb=2
convert %%i output\%%~ni.pdf
convert -units pixelsperinch %%i -resample 150 tablet\%%~ni.pdf
)
cd output
pdftk *.pdf "D:\Retro-Work\brought_to_you_by.pdf" cat output "%folder%\_manual.pdf"
cd ..\tablet
pdftk *.pdf "D:\Retro-Work\brought_to_you_by_[TABLET].pdf" cat output "%folder%\_tablet.pdf"
cd ..
del output\*.pdf /q
del tablet\*.pdf /q
rd output
rd tablet
cd %folder%
start _manual.pdf
start _tablet.pdf
pause