Obsah

Skenování dokumentů

Aktuální verze 5 využívá program bin/scang.exe a nastavení dokumenty_dokumenty.SCANG_PARAMS

Windows

scan-dokument.cmd

@echo off
REM %1 - co se ma delat
REM %2 - pri scanovani cislo stranky, pri pdf pocet stran (maximalni c.stranky)
REM %3 - pri scanovani nic, pri pdf nazev souboru vcetne absolutni cesty
SET irfan_dir=o:\irfanview\
SET imagemagick_dir=o:\imagemagick\
SET cmdtwain_dir=o:\cmdtwain\
SET scan_dir=%TMP%\scanobis
if not EXIST %scan_dir% mkdir %scan_dir%
REM priprava tempu
REM DEL /F /Q %scan_dir%\*.jpg 2>nul
REM DEL /F /Q %scan_dir%\*.bmp 2>nul 
REM DEL /F /Q %scan_dir%\*.tif 2>nul
goto %1



REM scanovani pres iview
:scan_iview
%irfan_dir%i_view32.exe /scanhidden /dpi=(150,150) /convert=%scan_dir%\%2.bmp

goto end

REM scanovani pres cmdtwain
:scan_cmdtwain
%cmdtwain_dir%CmdTwain.exe /DPI=150 /BMP %scan_dir%\%2.bmp 

goto end

REM tvorba pdf pres iview
:pdf_iview
for %%a in (%scan_dir%\*.bmp) do start /w %irfan_dir%i_view32.exe %%a /crop=(0,0,1240,1754) /advancedbatch /convert=%%a && start /w %irfan_dir%i_view32.exe %%a /append=%scan_dir%\obis-scan.tif /killmesoftly /silent
%irfan_dir%i_view32.exe %scan_dir%\obis-scan.tif /convert=%3
DEL /F /Q %scan_dir%\*.bmp 2>nul
DEL /F /Q %scan_dir%\*.tif 2>nul

goto end

REM tvorba pdf pres imagemagick
:pdf_im
%imagemagick_dir%mogrify -normalize -unsharp 4.0x1.0 -crop 1240x1754+0+0 -format jpg -quality 80 %scan_dir%\*.bmp 2>nul
%imagemagick_dir%convert %scan_dir%\*.jpg %3 2>nul
DEL /F /Q %scan_dir%\*.jpg 2>nul
DEL /F /Q %scan_dir%\*.bmp 2>nul

goto end

:end