ArchivedTools/ScanScripts/Windows/magazines/2 - Make AudioMedia magazine_(no_last_page).cmd

48 lines
819 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
set thumb=1
if NOT EXIST audiomedia mkdir audiomedia
for %%i in (*.tif) DO (
if !thumb!==1 (
convert %%i -resize 240x310^^! -quality 75%% !folder!\thumb.jpg
)
set thumb=2
convert -units pixelsperinch %%i -resample 150 audiomedia\%%~ni.jpg
convert %%i -quality 95%% output\%%~ni.jpg
)
rem 300dpi mag
cd output
for %%i in (*.jpg) DO (
convert %%i %%~ni.pdf
)
del *.jpg /q
pdftk *.pdf cat output "%folder%\mag.pdf"
del *.pdf /q
cd ..
rem Tablet
cd audiomedia
for %%i in (*.jpg) DO (
convert %%i %%~ni.pdf
)
del *.jpg /q
pdftk *.pdf output "%folder%\audiomedia.pdf"
del *.pdf /q
pause