On Wed, Apr 08, 2009 at 12:17:04PM +0200, Florian Lohoff wrote:
>       TMPDIR=$1
> 
>       unpaper=/usr/bin/unpaper
>       pnmtotiff=/usr/bin/pnmtotiff
>       tiffcp=/usr/bin/tiffcp
>       tiff2pdf=/usr/bin/tiff2pdf
> 
>       set -x
> 
>       OUTPUT=~/Desktop/scan-`date +%Y%m%d%H%M%S`.pdf
> 
>       ${unpaper} -v --layout none ${TMPDIR}/scan-%d.pnm 
> ${TMPDIR}/unpaper-%d.pnm
> 
>       for file in ${TMPDIR}/unpaper*; do
>               ${pnmtotiff} $file >$file.tiff
>       done
> 
>       ${tiffcp} ${TMPDIR}/*.tiff ${TMPDIR}/allpages.tiff
> 
>       ${tiff2pdf} -z -o ${OUTPUT} ${TMPDIR}/allpages.tiff 
> 
> Der naechste schritt waere noch via tesseract ein OCR und das
> als comment ans PDF haengen - aber das beim naechsten mal.
> 
> Jetzt erstmal - Wie werde ich "leere" seiten los?

Okay - die 20kbyte scheinen ganz gut - so loese ich das jetzt und
bisher klappts gut ... 

        #!/bin/sh

        TMPDIR=$1

        blankpagesize=20k
        unpaper=/usr/bin/unpaper
        pnmtojpeg=/usr/bin/pnmtojpeg
        pnmtotiff=/usr/bin/pnmtotiff
        tiffcp=/usr/bin/tiffcp
        tiff2pdf=/usr/bin/tiff2pdf
        pnmtopng=/usr/bin/pnmtopng

        set -x

        OUTPUT=~/Desktop/scan-`date +%Y%m%d%H%M%S`.pdf

        ${unpaper} -v --layout none ${TMPDIR}/scan-%d.pnm 
${TMPDIR}/unpaper-%d.pnm

        for file in ${TMPDIR}/unpaper*; do
                ${pnmtotiff} $file >$file.tiff.uncompress
                ${tiffcp} -c zip:2 $file.tiff.uncompress $file.tiff
        done

        files=`find ${TMPDIR} -iname "unpaper*tiff" -size +$blankpagesize`

        ${tiffcp} ${files} ${TMPDIR}/allpages.tiff

        ${tiff2pdf} -z -o ${OUTPUT} ${TMPDIR}/allpages.tiff 

        ls -la ${TMPDIR}

Flo
-- 
Florian Lohoff                  [email protected]             +49-171-2280134
        Those who would give up a little freedom to get a little 
          security shall soon have neither - Benjamin Franklin

Attachment: signature.asc
Description: Digital signature

--
Linux mailing list [email protected]
subscribe/unsubscribe: http://lug-owl.de/mailman/listinfo/linux
Hinweise zur Nutzung: http://www.lug-owl.de/Mailingliste/hints.epo

Antwort per Email an