74 lines
1.3 KiB
Batchfile
74 lines
1.3 KiB
Batchfile
@echo off
|
|
rem *****************************
|
|
rem * 2015 Carsten Jensen / DDHF
|
|
rem * Script til behandling af
|
|
rem * indscannede sider
|
|
rem *****************************
|
|
|
|
|
|
setlocal EnableDelayedExpansion
|
|
set folder=%cd%
|
|
cd work\out
|
|
echo tryk CTRL-C hvis du vil afbryde processen.
|
|
choice /m "Ret side orden "
|
|
if %errorlevel%==1 (
|
|
|
|
REM Rediger nedenstående stå så den passer med dit setup.
|
|
copy ..\correct_pages.php .\ /y
|
|
php -f correct_pages.php
|
|
cd newpages
|
|
)
|
|
|
|
if NOT EXIST output mkdir output
|
|
set thumb=1
|
|
|
|
|
|
choice /C SF /m "S/H (S) eller Farver (jpg komprimering) (F)"
|
|
echo.
|
|
echo Arbejder vent venligst...
|
|
echo.
|
|
|
|
if %errorlevel%==2 (
|
|
REM Opret Farve Dokument (jpg komprimering)
|
|
for %%i in (*.tif) DO (
|
|
if !thumb!==1 (
|
|
convert %%i -resize 240x310^^! -quality 75%% "!folder!\thumb.jpg"
|
|
)
|
|
set thumb=2
|
|
convert %%i -quality 95%% output\%%~ni.jpg
|
|
)
|
|
|
|
cd output
|
|
for %%i in (*.jpg) DO (
|
|
convert %%i %%~ni.pdf
|
|
)
|
|
del *.jpg /q
|
|
) else if %errorlevel%==1 (
|
|
REM Opret S/H Dokument (ingen jpg komprimering)
|
|
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
|
|
)
|
|
cd output
|
|
) else goto error
|
|
|
|
|
|
pdftk *.pdf cat output %folder%\dokument.pdf
|
|
del *.pdf /q
|
|
|
|
:success
|
|
Echo PDF + Thumb oprettet
|
|
goto end
|
|
|
|
:error
|
|
Echo der opstod en fejl, evt i dit valg.
|
|
goto end
|
|
|
|
|
|
|
|
:end
|
|
pause
|