pct-scanner-scripts-0.0.4.orig/0000755000175000017500000000000011164477034015333 5ustar jellejellepct-scanner-scripts-0.0.4.orig/lang/0000755000175000017500000000000011164466060016251 5ustar jellejellepct-scanner-scripts-0.0.4.orig/lang/pct-scanner-script-nl.po0000600000175000017500000000674211164466060022740 0ustar jellejelle#: pct-scanner-script:58 msgid "Usage: $0 --help" msgstr "Gebruik: $0 --help" #: pct-scanner-script:59 msgid "Version: $version" msgstr "Versie: $version" #: pct-scanner-script:60 msgid "Author: $author" msgstr "Maker: $author" #: pct-scanner-script:61 msgid "Donation: $donation" msgstr "Donatie: $donation" #: pct-scanner-script:168 msgid "invalid option: $1" msgstr "verkeerd argument $1" #: pct-scanner-script:245 msgid "dependencies not fulfilled, please install all necessary application" msgstr "benodigde programmas niet gevonden, aub alle noodzakelijke applicaties installeren" #: pct-scanner-script:246 msgid "hint: you may try to install the sane package that contains the scanadf program" msgstr "tip: probeer het sane pakket the installeren deze bevat het nodige scanadf programma" #: pct-scanner-script:247 msgid "hint: on debian based system the sane package can be isntalled with sudo apt-get install sane" msgstr "tip: op debian systemen het sane pakket kan gesinstallerd worden met: sudo apt-get install sane" #: pct-scanner-script:255 msgid "outdir not set, try adding --outdir $HOME, closing now" msgstr "opslaan locatie niet opgegeven, probeer argument --output $HOME toe te voegen, ik kan nu niet verder gaan" #: pct-scanner-script:258 msgid "device not set, try adding --device net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC, closing now" msgstr "device niet opgegeven, probeer argument --device net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC toe te voegen, ik kan nu niet verder" #: pct-scanner-script:261 msgid "source not set, try adding --source adf, closing now" msgstr "scanbron niet opgegeven, probeer argument --source adf toe te voegen, ik kan nu niet verder gaan" #: pct-scanner-script:264 msgid "resolution not set, try adding --resolution 600, closing now" msgstr "resoltutie niet opgegeven, probeer argument --resolution 600 toe te voegen, ik kan nu niet verder gaan" #: pct-scanner-script:308 msgid "counter: $startcount" msgstr "pagina: $startcount" #: pct-scanner-script:320 msgid "startcount: $startcount" msgstr "begin: $startcount" #: pct-scanner-script:322 msgid "startcount is not detected, closing now" msgstr "startcount argument is niet gevonden, ik kan nu niet verder gaan" #: pct-scanner-script:333 msgid "searching for scanadf scanners and there options, please standby ..." msgstr "zoek naar scanadf scanners en de mogelijke argumenten, aub geduld ..." #: pct-scanner-script:342 msgid "lineart: yes" msgstr "lineart: ja" #: pct-scanner-script:343 msgid "device: $DEVICE" msgstr "apparaat: $DEVICE" #: pct-scanner-script:344 msgid "outdir: $OUTDIR/scanscript/" msgstr "opslaan: $OUTDIR/scanscript/" #: pct-scanner-script:345 msgid "log: $LOG" msgstr "logboek: $LOG" #: pct-scanner-script:346 msgid "source: $SOURCE" msgstr "bron: $SOURCE" #: pct-scanner-script:347 msgid "resolution: $RESOLUTION" msgstr "resolutie: $RESOLUTION" #: pct-scanner-script:348 msgid "scanning of document has started, please standby ..." msgstr "scannen van document is begonnen, aub geduld ..." #: pct-scanner-script:359 msgid "color: yes" msgstr "kleur: ja" #: pct-scanner-script:376 msgid "grayscale: yes" msgstr "grayscale: ja" #: pct-scanner-script:407 msgid "pct-scanner-script: configuration variables not found, exiting now" msgstr "pct-scanner-script: configuratie argumenten niet gevonden, ik sluit nu af" #: pct-scanner-script:413 msgid "processing: completed, closing now" msgstr "verwerken: ik ben nu klaar en sluit af" pct-scanner-scripts-0.0.4.orig/lang/pct-scanner-script-process-nl.po0000600000175000017500000000135711164466060024411 0ustar jellejelle#: pct-scanner-script-process:47 msgid "processing: page: $input" msgstr "verwerken: pagina: $input" #: pct-scanner-script-process:53 msgid "processing: next page: $count" msgstr "verwerken: volgende pagina: $count" #: pct-scanner-script-process:68 msgid "processing: all needed variables are found, continuing now" msgstr "verwerken: alle benodigde parameters gevonden, ik ga nu verder, aub geduld ..." #: pct-scanner-script-process:70 msgid "processing: system variables not found, exiting now" msgstr "verwerken: benodigde parameters zijn niet gevonden, ik stop nu" #: pct-scanner-script-process:97 msgid "processing: executing c44 compression command, please standby ..." msgstr "verwerken: uitvoeren c44 compressie programma, aub geduld ..." pct-scanner-scripts-0.0.4.orig/notes0000600000175000017500000001366711164466060016410 0ustar jellejellesudo apt-get install sane http://www.avision.de/index.php?content=AV8350 http://www.kirchgessner.net/sane.html sudo geany /etc/sane.d/hp.conf option dumb-read lsusb Bus 004 Device 007: ID 03f0:0601 Hewlett-Packard ScanJet 6300c man sane-hp man sane-usb scanadf --help scanadf --help -d hp:libusb:001:003 scanadf --list-devices --verbose --output-file ~/scanjet-output usb 0x03f0 0x0601 --device-name cat /etc/sane.d/hp.conf # HP ScanJet 63X0C usb 0x03f0 0x0601 --scantype=ADF --device-name hp scanadf --verbose --device-name hp --source adf --resolution 600 --mode color -x 209.99mm -y 296.888mm --output-file image-%04d. scanadf --verbose --device-name hp --source adf --resolution 600 --mode grayscale -x 209.99mm -y 296.888mm --output-file image-%04d. scanadf --verbose --device-name hp --source adf --resolution 300 --mode grayscale -x 209.99mm -y 296.888mm --output-file image-%04d. scanadf --verbose --device-name hp --source adf --resolution 600 --mode lineart -x 210mm -y 297mm --output-file image-%04d.pbm scanadf --verbose --device-name hp --no-overwrite --scan-script ~/scanjet/scanjet-scanscript.sh --output-file ~/scanjet/image-0003.pbm --source adf --resolution 600 --mode lineart -x 210.000mm -y 297.000mm scanadf --verbose --device-name hp --source adf --speed fast --mode halftone cjb2 -verbose -clean image-%04d.pbm document-%04d.djvu sudo apt-get install gscan2pdf scanimage --help scanimage --verbose --progress --device-name hp --batch --mode gray --format pnm -x 210 -y 297 -- -- -- -- -- sudo apt-get install djvulibre-bin djvulibre-plugin convert image-0001.pbm document.djvu convert: unable to open module file `/usr/lib/ImageMagick-6.2.4/modules-Q16/coders/djvu.la': No such file or directory. tested: is broken - 05-01-2008 - Jelle de Jong -- -- -- -- -- -- -- -- -- -- # converting scanned pbm image to djvu document cjb2 -verbose -clean -dpi 300 ~/scanjet/image-0002.pbm ~/scanjet/document-0002.djvu # extract scanned pbm image back out of the djvu document ddjvu -verbose -format=pbm ~/scanjet/document-0002.djvu ~/scanjet/image-ddjvu-0002.pbm tested: working perfect - 05-01-2008 - Jelle de Jong -- -- -- -- -- -- -- -- -- -- lpoptions -p "HP_PSC_2110" -l lpoptions -p "HP_PSC_2110" -o PageSize=A4 -o PrintoutMode=High.Gray -o InputSlot=Default -o Duplex=None -o Quality=600GrayscaleCMYK lpr -P "HP_PSC_2110" -#1 -o Collate=True -o media=A4 -o outputorder=normal -o sides=one-sided -o scaling=100 -o saturation=0 ~/scanjet/image-0001.pbm lpr -P "HP_PSC_2110" -#1 -o Collate=True -o media=A4 -o outputorder=normal -o sides=one-sided -o scaling=100 -o saturation=0 -o page-left=0 -o page-right=0 -o page-top=0 -o page-bottom=0 ~/scanjet/image-0001.pbm tested: printing pbm images is borking, created bug report for cups - 06-01-2008 - Jelle de Jong bug report: http://www.cups.org/str.php?L2653 -- -- -- -- -- -- -- -- -- -- # prepairing the source image for printing: bug report: http://www.cups.org/str.php?L2653 convert ~/scanjet/image-0001.pbm ~/scanjet/image-0001.png identify ~/scanjet/image-0001.png # set the printer settings and the print the image with the cups commands, this is without setting the page margings lpoptions -p "HP_PSC_2110" -o PageSize=A4 -o PrintoutMode=High.Gray -o InputSlot=Default -o Duplex=None -o Quality=600GrayscaleCMYK lpr -P "HP_PSC_2110" -#1 -o Collate=True -o media=A4 -o outputorder=normal -o sides=one-sided -o scaling=100 -o saturation=0 ~/scanjet/image-0001.png tested: this will result in a printout that is not 1:1 with the source image because the margins of the printer configuration - 06-01-2008 - Jelle de Jong # set the printer settings and the print command, this is with the page margins set lpoptions -p "HP_PSC_2110" -o PageSize=A4 -o PrintoutMode=High.Gray -o InputSlot=Default -o Duplex=None -o Quality=600GrayscaleCMYK lpr -P "HP_PSC_2110" -#1 -o Collate=True -o media=A4 -o outputorder=normal -o sides=one-sided -o scaling=100 -o saturation=0 -o page-left=0 -o page-right=0 -o page-top=0 -o page-bottom=0 ~/scanjet/image-0001.png tested: this will result in a good match with the source image, unlike what the documentation explains about the print margins these options also works with images. - 06-01-2008 - Jelle de Jong documentation: http://www.cups.org/documentation.php/options.html -- -- -- -- -- -- -- -- -- -- scanadf --verbose --device-name hp --no-overwrite --scan-script ~/scanjet/scanjet-scanscript.sh --output-file ~/scanjet/image-0003.pbm --source adf --resolution 600 --mode lineart -x 210.000mm -y 297.000mm cjb2 -verbose -clean -dpi 600 ~/scanjet/image-0003.pbm ~/scanjet/document-0003.djvu djvups -verbose -format=ps -copies=1 -orientation=auto -color=no ~/scanjet/document-0003.djvu ~/scanjet/document-0003.ps 210mm x 297mm (21.0/2.54) x 600 = 4960.629 = 4960 (29.7/2.54) x 600 = 7015.758 = 7015 convert -crop 4960x7015 ~/scanjet/image-0003.pbm ~/scanjet/image-convert-0003.pbm cjb2 -verbose -clean -dpi 600 ~/scanjet/image-convert-0003.pbm ~/scanjet/document-convert-0003.djvu djvups -verbose -format=ps -level=3 -orientation=portrait -color=no -zoom=100 ~/scanjet/document-multi-page.djvu ~/scanjet/document-multi-page.ps %%Pages: 6 %%BoundingBox: 0 0 595 842 <>setpagedevice http://opencircuitdesign.com/xcircuit/ lpoptions -p "Generic_PCL_6_Printer" -l lpr -P "Generic_PCL_6_Printer" -#1 -o Collate=True -o media=A4 -o page-ranges=1 -o outputorder=normal -o sides=one-sided ~/scanjet/document-multi-page.ps -- -- -- -- -- -- -- -- -- -- identify -verbose image-0001.pbm image-0001.pbm PNM 4962x7018 PseudoClass 2c 4.2mb 2.890u 0:04 -- -- -- -- -- D [06/Jan/2008:20:24:40 +0000] [Job 175] Copying page 1... D [06/Jan/2008:20:24:40 +0000] [Job 175] pagew = 559.0, pagel = 813.2 D [06/Jan/2008:20:24:40 +0000] [Job 175] bboxw = 595, bboxl = 842 D [06/Jan/2008:20:24:40 +0000] [Job 175] PageLeft = 18.0, PageRight = 577.0 D [06/Jan/2008:20:24:40 +0000] [Job 175] PageTop = 827.6, PageBottom = 14.4 D [06/Jan/2008:20:24:40 +0000] [Job 175] PageWidth = 595.0, PageLength = 842.0 pct-scanner-scripts-0.0.4.orig/pct-scanner-script-process0000700000175000017500000003317211164466060022445 0ustar jellejelle#!/bin/bash # Company: PowerCraft Technology # Author: Copyright Jelle de Jong # Note: Please send me an email if you enhanced the script # Date: 2009-01-09 / 2009-01-19 / ... / 2009-02-24 / 2009-03-31 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. # set -x # exec 2>$HOME/pct-scanner-script-process.log # STRACE=$(which strace) TEXTDOMAINDIR=/usr/share/locale TEXTDOMAIN=pct-scanner-script-process file="$1" version="0.0.4" function process_busy_set() { if [ -d "$OUTDIR"/scanscript/ ] then mkdir --parents "$OUTDIR"/scanscript/ fi processbusy=$(mktemp -p "$OUTDIR"/scanscript/ .processbusy.txt) trap "rm -f $processbusy" 0 1 2 3 15 } function process_counter() { logfile="$1" input=$(head -n 1 "$logfile") input=${input##*: } if [ -n "$input" ] then echo $"processing: page: $input" count=${input} let count+=1 find='counter:.*' replace="counter: $count" sed -i -e "s,$find,$replace,g" "$logfile" echo $"processing: next page: $count" fi } function process_grayscale() { sourcefile="$1" logfile="$LOG" date=$(date) dirname=${sourcefile%/*} filename=${sourcefile##*/}; filename=${filename%.*} extension=${sourcefile##*.} if [ ! -z "$SCAN_RES" ] && [ ! -z "$SCAN_WIDTH" ] && [ ! -z "$SCAN_HEIGHT" ] && [ ! -z "$SCAN_DEPTH" ] && [ ! -z "$SCAN_FORMAT" ]&& [ ! -z "$SCAN_FORMAT_ID" ]; then echo $"processing: all needed variables are found, continuing now" else echo 1>&2 $"processing: system variables not found, exiting now" exit 1 fi echo "-- -- -- -- -- -- -- --" >> "$logfile" echo "date: $date" >> "$logfile" echo "scanadf: res:$SCAN_RES width:$SCAN_WIDTH height:$SCAN_HEIGHT depth:$SCAN_DEPTH format:$SCAN_FORMAT id:$SCAN_FORMAT_ID" >> "$logfile" echo "processing: convert $sourcefile $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg" >> "$logfile" $STRACE convert "$sourcefile" $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg if [ -z $NOPDF ]; then echo "processing: convert $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf" >> "$logfile" $STRACE convert $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf if [ -e $OUTDIR/scanscript/output/document-multi-page-grayscale.pdf ] && [ -e $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf ] then mv $OUTDIR/scanscript/output/document-multi-page-grayscale.pdf $OUTDIR/scanscript/output/document-multi-page-old.pdf pdftk $OUTDIR/scanscript/output/document-multi-page-old.pdf $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf cat output $OUTDIR/scanscript/output/document-multi-page-grayscale.pdf rm $OUTDIR/scanscript/output/document-multi-page-old.pdf else pdftk $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf cat output $OUTDIR/scanscript/output/document-multi-page-grayscale.pdf fi fi if [ -z $NODJVU ]; then echo "processing: c44 -crcbnone -dpi $SCAN_RES $sourcefile $OUTDIR/scanscript/processing/document-single-page-$filename.djvu" >> "$logfile" echo $"processing: executing c44 compression command, please standby ..." c44 -crcbnone -dpi $SCAN_RES "$sourcefile" $OUTDIR/scanscript/processing/document-single-page-$filename.djvu $EXEC_VERBOSE # cpaldjvu -verbose -bgwhite -colors 8 -dpi 600 image-0007.pgm $OUTDIR/scanscript/processing/document-single-page-image-0007.djvu # c44 -crcbnone -dpi 600 image-0008.pgm $OUTDIR/scanscript/processing/document-single-page-image-0008.djvu if [ -e $OUTDIR/scanscript/output/document-multi-page-grayscale.djvu ] && [ -e $OUTDIR/scanscript/processing/document-single-page-$filename.djvu ] then djvm -insert $OUTDIR/scanscript/output/document-multi-page-grayscale.djvu $OUTDIR/scanscript/processing/document-single-page-$filename.djvu else djvm -create $OUTDIR/scanscript/output/document-multi-page-grayscale.djvu $OUTDIR/scanscript/processing/document-single-page-$filename.djvu fi fi if [ ! -z "$RMINPUT" ]; then echo "processing: removing input file: $sourcefile" >> "$logfile" rm $VERBOSE "$sourcefile" fi echo "-- -- -- -- -- -- -- --" >> "$logfile" process_counter "$logfile" scanbusy="$OUTDIR"/scanscript/.scanbusy.txt if [ ! -z "$OPEN" ] && [ -z "$NODJVU" ] && [ ! -e "$scanbusy" ]; then nohup "$OPEN" "$OUTDIR"/scanscript/output/document-multi-page-grayscale.djvu > "$OUTDIR"/scanscript/.open.log 2>/dev/null & elif [ ! -z "$OPEN" ] && [ -z "$NOPDF" ] && [ ! -e "$scanbusy" ]; then nohup "$OPEN" "$OUTDIR"/scanscript/output/document-multi-page-grayscale.pdf > "$OUTDIR"/scanscript/.open.log 2>/dev/null & fi return } function process_color() { sourcefile="$1" logfile="$LOG" date=$(date) dirname=${sourcefile%/*} filename=${sourcefile##*/}; filename=${filename%.*} extension=${sourcefile##*.} if [ ! -z "$SCAN_RES" ] && [ ! -z "$SCAN_WIDTH" ] && [ ! -z "$SCAN_HEIGHT" ] && [ ! -z "$SCAN_DEPTH" ] && [ ! -z "$SCAN_FORMAT" ]&& [ ! -z "$SCAN_FORMAT_ID" ]; then echo $"processing: all needed variables are found, continuing now" else echo 1>&2 $"processing: system variables not found, exiting now" exit 1 fi echo "-- -- -- -- -- -- -- --" >> "$logfile" echo "date: $date" >> "$logfile" echo "scanadf: res:$SCAN_RES width:$SCAN_WIDTH height:$SCAN_HEIGHT depth:$SCAN_DEPTH format:$SCAN_FORMAT id:$SCAN_FORMAT_ID" >> "$logfile" echo "processing: convert $sourcefile $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg" >> "$logfile" $STRACE convert "$sourcefile" "$OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg" if [ -z $NOPDF ]; then echo "processing: convert $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf" >> "$logfile" $STRACE convert "$OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg" "$OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf" if [ -e $OUTDIR/scanscript/output/document-multi-page-color.pdf ] && [ -e $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf ] then mv $OUTDIR/scanscript/output/document-multi-page-color.pdf $OUTDIR/scanscript/output/document-multi-page-old.pdf pdftk $OUTDIR/scanscript/output/document-multi-page-old.pdf $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf cat output $OUTDIR/scanscript/output/document-multi-page-color.pdf rm $OUTDIR/scanscript/output/document-multi-page-old.pdf else pdftk $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf cat output $OUTDIR/scanscript/output/document-multi-page-color.pdf fi fi if [ -z $NODJVU ]; then echo "processing: c44 -dpi $SCAN_RES $sourcefile $OUTDIR/scanscript/processing/document-single-page-$filename.djvu" >> "$logfile" echo $"processing: executing c44 compression command, please standby ..." c44 -dpi $SCAN_RES "$sourcefile" $OUTDIR/scanscript/processing/document-single-page-$filename.djvu $EXEC_VERBOSE # cpaldjvu -verbose -bgwhite -colors 8 -dpi 600 image-0007.pgm $OUTDIR/scanscript/processing/document-single-page-image-0007.djvu # c44 -crcbnone -dpi 600 image-0008.pgm $OUTDIR/scanscript/processing/document-single-page-image-0008.djvu # cpaldjvu -verbose -dpi $SCAN_RES -bgwhite "$sourcefile" ~/scanjet/processing/document-single-page-$filename.djvu # c44 -dpi 600 /home/jelle/scanjet/input/image-0001.ppm /home/jelle/scanjet/processing/document-single-page-image-0001.djvu if [ -e $OUTDIR/scanscript/output/document-multi-page-color.djvu ] && [ -e $OUTDIR/scanscript/processing/document-single-page-$filename.djvu ] then djvm -insert $OUTDIR/scanscript/output/document-multi-page-color.djvu $OUTDIR/scanscript/processing/document-single-page-$filename.djvu else djvm -create $OUTDIR/scanscript/output/document-multi-page-color.djvu $OUTDIR/scanscript/processing/document-single-page-$filename.djvu fi fi if [ ! -z "$RMINPUT" ]; then echo "processing: removing input file: $sourcefile" >> "$logfile" rm $VERBOSE "$sourcefile" fi echo "-- -- -- -- -- -- -- --" >> "$logfile" process_counter "$logfile" scanbusy="$OUTDIR"/scanscript/.scanbusy.txt if [ ! -z "$OPEN" ] && [ -z "$NODJVU" ] && [ ! -e "$scanbusy" ]; then nohup "$OPEN" $OUTDIR/scanscript/output/document-multi-page-color.djvu > "$OUTDIR"/scanscript/.open.log 2>/dev/null & elif [ ! -z "$OPEN" ] && [ -z "$NOPDF" ] && [ ! -e "$scanbusy" ]; then nohup "$OPEN" $OUTDIR/scanscript/output/document-multi-page-color.pdf > "$OUTDIR"/scanscript/.open.log 2>/dev/null & fi return } function process_lineart() { sourcefile="$1" logfile="$LOG" date=$(date) dirname=${sourcefile%/*} filename=${sourcefile##*/}; filename=${filename%.*} extension=${sourcefile##*.} if [ ! -z "$SCAN_RES" ] && [ ! -z "$SCAN_WIDTH" ] && [ ! -z "$SCAN_HEIGHT" ] && [ ! -z "$SCAN_DEPTH" ] && [ ! -z "$SCAN_FORMAT" ]&& [ ! -z "$SCAN_FORMAT_ID" ]; then echo $"processing: all needed variables are found, continuing now" else echo 1>&2 $"processing: system variables not found, exiting now" exit 1 fi echo "-- -- -- -- -- -- -- --" >> "$logfile" echo "date: $date" >> "$logfile" echo "scanadf: res:$SCAN_RES width:$SCAN_WIDTH height:$SCAN_HEIGHT depth:$SCAN_DEPTH format:$SCAN_FORMAT id:$SCAN_FORMAT_ID" >> "$logfile" echo "processing: convert $sourcefile $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg" >> "$logfile" $STRACE convert "$sourcefile" $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg if [ -z $NODJVU ]; then echo "processing: cjb2 -verbose -clean -dpi $SCAN_RES $sourcefile $OUTDIR/scanscript/processing/document-single-page-$filename.djvu" >> "$logfile" cjb2 -verbose -clean -dpi $SCAN_RES "$sourcefile" $OUTDIR/scanscript/processing/document-single-page-$filename.djvu $EXEC_VERBOSE if [ -e $OUTDIR/scanscript/output/document-multi-page-lineart.djvu ] && [ -e $OUTDIR/scanscript/processing/document-single-page-$filename.djvu ] then djvm -insert $OUTDIR/scanscript/output/document-multi-page-lineart.djvu $OUTDIR/scanscript/processing/document-single-page-$filename.djvu else djvm -create $OUTDIR/scanscript/output/document-multi-page-lineart.djvu $OUTDIR/scanscript/processing/document-single-page-$filename.djvu fi fi if [ -z $NOPDF ]; then echo "processing: convert $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf" >> "$logfile" $STRACE convert $OUTDIR/scanscript/processing/jpg/image-single-$filename.jpg $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf if [ -e $OUTDIR/scanscript/output/document-multi-page-lineart.pdf ] && [ -e $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf ] then mv $OUTDIR/scanscript/output/document-multi-page-lineart.pdf $OUTDIR/scanscript/output/document-multi-page-old.pdf pdftk $OUTDIR/scanscript/output/document-multi-page-old.pdf $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf cat output $OUTDIR/scanscript/output/document-multi-page-lineart.pdf rm $OUTDIR/scanscript/output/document-multi-page-old.pdf else pdftk $OUTDIR/scanscript/processing/pdf/document-single-page-$filename.pdf cat output $OUTDIR/scanscript/output/document-multi-page-lineart.pdf fi fi if [ ! -z "$RMINPUT" ]; then echo "processing: removing input file: $sourcefile" >> "$logfile" rm $VERBOSE "$sourcefile" fi echo "-- -- -- -- -- -- -- --" >> "$logfile" process_counter "$logfile" scanbusy="$OUTDIR"/scanscript/.scanbusy.txt if [ ! -z "$OPEN" ] && [ -z "$NODJVU" ] && [ ! -e "$scanbusy" ]; then nohup "$OPEN" $OUTDIR/scanscript/output/document-multi-page-lineart.djvu > "$OUTDIR"/scanscript/.open.log 2>/dev/null & elif [ ! -z "$OPEN" ] && [ -z "$NOPDF" ] && [ ! -e "$scanbusy" ]; then nohup "$OPEN" $OUTDIR/scanscript/output/document-multi-page-lineart.pdf > "$OUTDIR"/scanscript/.open.log 2>/dev/null & fi return } if [ ! -z "$LOG" ] && [ ! -z "$OUTDIR" ]; then process_busy_set; if [ ! -z $LINEART ]; then process_lineart "$file"; elif [ ! -z $COLOR ]; then process_color "$file"; elif [ ! -z $GRAYSCALE ]; then process_grayscale "$file"; fi else echo 1>&2 $"processing: system variables not found, exiting now" exit 1 fi exit pct-scanner-scripts-0.0.4.orig/pct-scanner-script.conf0000600000175000017500000000232611164466060021711 0ustar jellejelle# pct-scanner-script --lineart [lineart] DEVICE=$(scanadf -L | cut -d ' ' -f 2 | sed -e 's/^`//;s/'"'"'//') SOURCE=ADF RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) RMINPUT=1 NOPDF=1 # pct-scanner-script --grayscale [grayscale] DEVICE=$(scanadf -L | cut -d ' ' -f 2 | sed -e 's/^`//;s/'"'"'//') SOURCE=ADF RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) RMINPUT=1 NOPDF=1 # pct-scanner-script --color [color] DEVICE=$(scanadf -L | cut -d ' ' -f 2 | sed -e 's/^`//;s/'"'"'//') SOURCE=ADF RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) RMINPUT=1 NOPDF=1 # pct-scanner-script --config lineart0 [lineart0] LINEART=1 DEVICE=net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC SOURCE=Flatbed RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) RMINPUT=1 NOPDF=1 # pct-scanner-script --config grayscale0 [grayscale0] GRAYSCALE=1 DEVICE=net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC SOURCE=Flatbed RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) RMINPUT=1 NOPDF=1 # pct-scanner-script --config color0 [color0] COLOR=1 DEVICE=net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC SOURCE=Flatbed RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) RMINPUT=1 NOPDF=1 pct-scanner-scripts-0.0.4.orig/changelog0000700000175000017500000000506111164466060017175 0ustar jellejelle2009-03-30 20:55 Jelle de Jong * changing processing script to /usr/lib/pct-scanner-scripts instead of /var/lib/pct-scanner-scripts/ * recreating the manpage * removing connections to company in manpage and descriptions * adding Homepage and Licence to version info * adding README file with currently xbindkeys notes 2009-02-26 14:30 Jelle de Jong * extensive testing, qa usable in production * wraped directory_clean function inside the scan function so that pct-scanner-script --color --source flatbed --clean and pct-scanner-script --clean --outdir /home/jelle * make --source flatbed and --source Flatbed trigger correctly * make --verbose also active on exectuted programs ($EXEC_VERBOSE) * tweaked the default configuration files 2009-02-25 01:20 Jelle de Jong * adding localization support adding dutch translation po files * using echo 1>&2 for error messages * activated default configurations in configuration file * added 2>/dev/null to suppress output of running commands 2009-01-30 01:22 Jelle de Jong * it appears scanadf is using some black magic to start it child processing script. When scanadf closes and the bash script continues and closes, it sents a SIGHUP (Hangup) killing the running process job ;-(, i tried using wait and nohup and disown at various places but no luck, so I made a file set and unset flag to scan if the processing script was still running, this solved the issues. * fixed typo bug "unset NODFJU > unset NODJVU" * replaced OUTDIR="$HOME" > OUTDIR=${HOME} * some small text replacements 2009-01-29 00:12 Jelle de Jong * adding RMINPUT feature to configuration file so the input source that can be big 95MB+ will be removed after every processing. * fixed bug in command argument parsing --verbose had a double shift * added feature to stop scanning after one page when using the source Flatbed. * renamed some variables to possible prevent mistakes. 2009-01-28 22:00 Jelle de Jong * pct-scanner-script: setup_environment() moved directory creation under check for $OUTDIR else it tries to create directories under / get_configuration() fixed bug with appending section to configuration search string 2009-01-20 21:00 Jelle de Jong * Initial release pct-scanner-scripts-0.0.4.orig/locale/0000755000175000017500000000000011164466060016567 5ustar jellejellepct-scanner-scripts-0.0.4.orig/locale/nl/0000755000175000017500000000000011164466060017200 5ustar jellejellepct-scanner-scripts-0.0.4.orig/locale/nl/LC_MESSAGES/0000755000175000017500000000000011164466060020765 5ustar jellejellepct-scanner-scripts-0.0.4.orig/locale/nl/LC_MESSAGES/pct-scanner-script.mo0000600000175000017500000000564311164466060025041 0ustar jellejelle%`s Dx]O \ o |6B"<?|4D4C'S{ RQ _To  i] Iz & f R 0i E ` A @O     Author: $authorDonation: $donationUsage: $0 --helpVersion: $versioncolor: yescounter: $startcountdependencies not fulfilled, please install all necessary applicationdevice not set, try adding --device net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC, closing nowdevice: $DEVICEgrayscale: yeshint: on debian based system the sane package can be isntalled with sudo apt-get install sanehint: you may try to install the sane package that contains the scanadf programinvalid option: $1lineart: yeslog: $LOGoutdir not set, try adding --outdir $HOME, closing nowoutdir: $OUTDIR/scanscript/pct-scanner-script: configuration variables not found, exiting nowprocessing: completed, closing nowresolution not set, try adding --resolution 600, closing nowresolution: $RESOLUTIONscanning of document has started, please standby ...searching for scanadf scanners and there options, please standby ...source not set, try adding --source adf, closing nowsource: $SOURCEstartcount is not detected, closing nowstartcount: $startcountMaker: $authorDonatie: $donationGebruik: $0 --helpVersie: $versionkleur: japagina: $startcountbenodigde programmas niet gevonden, aub alle noodzakelijke applicaties installerendevice niet opgegeven, probeer argument --device net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC toe te voegen, ik kan nu niet verderapparaat: $DEVICEgrayscale: jatip: op debian systemen het sane pakket kan gesinstallerd worden met: sudo apt-get install sanetip: probeer het sane pakket the installeren deze bevat het nodige scanadf programmaverkeerd argument $1lineart: jalogboek: $LOGopslaan locatie niet opgegeven, probeer argument --output $HOME toe te voegen, ik kan nu niet verder gaanopslaan: $OUTDIR/scanscript/pct-scanner-script: configuratie argumenten niet gevonden, ik sluit nu afverwerken: ik ben nu klaar en sluit afresoltutie niet opgegeven, probeer argument --resolution 600 toe te voegen, ik kan nu niet verder gaanresolutie: $RESOLUTIONscannen van document is begonnen, aub geduld ...zoek naar scanadf scanners en de mogelijke argumenten, aub geduld ...scanbron niet opgegeven, probeer argument --source adf toe te voegen, ik kan nu niet verder gaanbron: $SOURCEstartcount argument is niet gevonden, ik kan nu niet verder gaanbegin: $startcountpct-scanner-scripts-0.0.4.orig/locale/nl/LC_MESSAGES/pct-scanner-script-process.mo0000600000175000017500000000117111164466060026505 0ustar jellejelleDl:A#3<Np=" >:processing: all needed variables are found, continuing nowprocessing: executing c44 compression command, please standby ...processing: next page: $countprocessing: page: $inputprocessing: system variables not found, exiting nowverwerken: alle benodigde parameters gevonden, ik ga nu verder, aub geduld ...verwerken: uitvoeren c44 compressie programma, aub geduld ...verwerken: volgende pagina: $countverwerken: pagina: $inputverwerken: benodigde parameters zijn niet gevonden, ik stop nupct-scanner-scripts-0.0.4.orig/pct-scanner-script0000700000175000017500000003602111164466060020765 0ustar jellejelle#!/bin/bash # Company: PowerCraft Technology # Author: Copyright Jelle de Jong # Note: Please send me an email if you enhanced the script # Date: 2009-01-09 / 2009-01-22 / ... / 2009-02-26 / 2009-03-31 # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. #~ set -x #~ exec 2>$HOME/pct-scanner-script.log TEXTDOMAINDIR=/usr/share/locale TEXTDOMAIN=pct-scanner-script version="0.0.4" author="Jelle de Jong " donation="http://www.tuxcrafter.net/pages/contact.html#paypal-donation" homepage="https://secure.powercraft.nl/svn/packages/trunk/source/pct-scanner-scripts/" licence="http://www.gnu.org/licenses/gpl-3.0.html" SYSCONF=/etc/pct-scanner-script.conf SYSDIR=/etc/pct-scanner-script.conf.d/ PROCESS=/usr/lib/pct-scanner-scripts/pct-scanner-script-process unset LINEART unset COLOR unset GRAYSCALE unset SEARCH unset RESUME unset OUTDIR unset DEVICE unset SOURCE unset RESOLUTION unset CONFIG unset OPEN unset NOPDF unset NODJVU unset CLEAN unset VERBOSE unset EXEC_VERBOSE function version() { echo $"Usage: $0 --help" echo $"Version: $version" echo $"Author: $author" echo $"Donation: $donation" echo $"Homepage: $homepage" echo $"Licence: $licence" } function usage() { echo "easy scan and create merged DjVu and PDF documents for archiving" echo echo "Usage: $0 [options]" echo echo "Options:" echo " -h, --help, -? show this help information" echo " -l, --lineart scan in lineart mode [recommended]" echo " -c, --color scan in color mode, when supported" echo " -g, --grayscale scan in grayscale mode, when supported" echo " -o, --outdir ... set the output location [check diskspace]" echo " -s, --source ... set the scan source, see --search" echo " -r, --resolution ... set the scan resolution, see --search" echo " -d, --device ... set the device resolution, see --search" echo " -m, --resume ... set the resume counter for the page number" echo " -e, --clean cleanup all files in outdir/scanscript/" echo " -p, --nopdf don't create PDF documents [recommend]" echo " -j, --nodjvu don't create DjVu documents" echo " -a, --search search for scan devices and there capabilities" echo " -n, --config ... set a configuration to use, when availible" echo " -v, --version show the version and author information" echo " -b, --verbose make commands verbose, providing more info" echo echo "Examples:" echo " pct-scanner-script --search" echo " pct-scanner-script --lineart --outdir $HOME --source ADF --resolution 600 --device net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC" echo " pct-scanner-script --resume 11 --lineart --outdir $HOME --source ADF --resolution 600 --device net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC" echo echo " pct-scanner-script --lineart" echo " pct-scanner-script --config config0" echo " pct-scanner-script --clean --config config0 --nopdf --verbose" echo echo "Configuration:" echo " $SYSCONF" echo " $SYSDIR" echo echo " In the configuration files most settings can be set, so not all" echo " command arguments are needed to start the program. This makes it" echo " very easy to setup your favorite setups and use it with only the" echo " --config myconfig0 argument. Please take a look inside the config" echo " files to get a better idea how to use them. The --config conf0" echo " argument can be used to select cascading configurations. As an" echo " example --lineart --config mystyle0 will use the section" echo " [lineart-mystyle0] in the configuration files. There is also an" echo " OPEN=COMMAND option in the configuration file to open the combined" echo " output file with a program of own choice, when the scan is done" echo echo " The config system uses a priority based cascading system, the" echo " command arguments options will overwrite the settings found in" echo " the configuration files, and config files with an higher number" echo " will overwrite previous found configuration files, but not the" echo " command line arguments, when they are used." echo echo "Description:" echo " Easy scan and create merged DjVu and PDF documents for archiving" echo " This package contains a script and configuration system to easy" echo " scan documents and create a digital archiving. It can create DjVu" echo " PDF and JPEG outputs, in merged and single files. It also has a" echo " configuration file system where different configurations can be" echo " defined, this makes it easy to switching between configurations." echo " The script is designed for productivity." echo echo "Features:" echo " - auto archiving, in merged and singe DjVu, PDF, and JPEG files" echo " - auto and manual resume when scanning somehow fails" echo " - cascading configuration system, for easy customizing" echo " - easy command line style bash program, with useful options" echo " - archiving made possible with both adf and normal scanners" echo " - build for productivity and daily use" echo " - uses bash, scanadf and other mainstream processing tools" echo " - multilanguage commandline output" echo echo " This program is a helper script to easy scan and automated digital" echo " document archiving for normal and adf scanners. You can debug this" echo " script by running it as bash -x pct-scanner-script [options]. The" echo " script is just a nice wrapper for the scanadf, DjVu and PDF tools" echo echo "Website:" echo " https://secure.powercraft.nl/svn/packages/" echo "Mailinglist:" echo " http://www.powercraft.nl/cgi-bin/mailman/listinfo/packages-commit" echo " http://www.powercraft.nl/cgi-bin/mailman/listinfo/packages-devel" } while [[ "$1" == -* ]]; do case "$1" in -h|--help|-\?) usage; exit 0;; -l|--lineart) LINEART=1; shift;; -c|--color) COLOR=1; shift;; -g|--grayscale|--gray) GRAYSCALE=1; shift;; -o|--outdir) OUTDIR="$2"; shift; shift;; -s|--source) SOURCE="$2"; shift; shift;; -r|--resolution) RESOLUTION="$2"; shift; shift;; -d|--device) DEVICE="$2"; shift; shift;; -m|--resume) RESUME="$2"; shift; shift;; -e|--clean) CLEAN=1; shift;; -p|--nopdf) NOPDF=1; shift;; -j|--nodjvu) NODJVU=1; shift;; -a|--search) SEARCH=1; shift;; -n|--config) CONFIG="$2"; shift; shift;; -b|--verbose) VERBOSE="--verbose"; shift;; -v|--version) version; exit 0;; --) shift; break;; -*) echo 1>&2 $"invalid option: $1"; usage; exit 1;; esac done function scan_busy_set() { if [ -d "$OUTDIR"/scanscript/ ] then mkdir --parents "$OUTDIR"/scanscript/ fi scanbusy=$(mktemp -p "$OUTDIR"/scanscript/ .scanbusy.txt) trap "rm -f $scanbusy" 0 1 2 3 15 } function scan_busy_unset() { scanbusy="$OUTDIR"/scanscript/.scanbusy.txt rm -f "$scanbusy" } function process_busy_scan() { seconds=0 scanbusy="$OUTDIR"/scanscript/.processbusy.txt while [ -e "$scanbusy" ] do /bin/sleep 3 seconds=$(($seconds+3)) done } function scan_configuration() { file="$1" unset options [ ! -z "$RESUME" ] && options+=("RESUME") [ ! -z "$OUTDIR" ] && options+=("OUTDIR") [ ! -z "$DEVICE" ] && options+=("DEVICE") [ ! -z "$SOURCE" ] && options+=("SOURCE") [ ! -z "$RESOLUTION" ] && options+=("RESOLUTION") for value in "${options[@]}" do sed -n -i -e "/$value/!p" "$file" done } function get_configuration() { section="$1" if [ ! -z "$section" ] && [ ! -z "$CONFIG" ]; then section+="-$CONFIG" elif [ -z "$section" ] && [ ! -z "$CONFIG" ]; then section="$CONFIG" fi [ ! -d "$SYSDIR" ] && mkdir --parents $VERBOSE "$SYSDIR" tempfile=$(mktemp -p "/tmp/" tempfile.XXXXXXXXXX) trap "rm -f $tempfile" 0 1 2 3 15 [ -z "$tempfile" ] && exit 1 files="$SYSCONF" files+=$'\n' files+=$(run-parts --list "$SYSDIR" ) if [ -n "$files" ]; then while read file; do set +e [ ! -r "$file" ] && continue sed -n '/^\['"$section"'\]$/,/^\[.*\]$/{//!p}' "$file" > "$tempfile" scan_configuration "$tempfile" . "$tempfile" set -e done < <(echo "$files") fi } function check_dependencies() { if [ -z $(which scanadf) ] then echo 1>&2 $"dependencies not fulfilled, please install all necessary application" echo 1>&2 $"hint: you may try to install the sane package that contains the scanadf program" echo 1>&2 $"hint: on debian based system the sane package can be isntalled with sudo apt-get install sane" exit 1 fi } function setup_environment() { if [ -z "$OUTDIR" ]; then echo 1>&2 $"outdir not set, try adding --outdir $HOME, closing now" exit 1 elif [ -z "$DEVICE" ]; then echo 1>&2 $"device not set, try adding --device net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC, closing now" exit 1 elif [ -z "$SOURCE" ]; then echo 1>&2 $"source not set, try adding --source adf, closing now" exit 1 elif [ -z "$RESOLUTION" ]; then echo 1>&2 $"resolution not set, try adding --resolution 600, closing now" exit 1 fi [ ! -d $OUTDIR/scanscript/input/ ] && mkdir $VERBOSE --parents $OUTDIR/scanscript/input/ [ ! -d $OUTDIR/scanscript/output/ ] && mkdir $VERBOSE --parents $OUTDIR/scanscript/output/ [ ! -d $OUTDIR/scanscript/processing/ ] && mkdir $VERBOSE --parents $OUTDIR/scanscript/processing/ [ ! -d $OUTDIR/scanscript/processing/jpg/ ] && mkdir $VERBOSE --parents $OUTDIR/scanscript/processing/jpg/ [ ! -d $OUTDIR/scanscript/processing/pdf/ ] && [ -z $NOPDF ] && mkdir $VERBOSE --parents $OUTDIR/scanscript/processing/pdf/ [ -z "$LOG" ] && LOG="$OUTDIR/scanscript/output/status.log" [ -z "$COMMAND" ] && COMMAND="$PROCESS" export OUTDIR="$OUTDIR" export LOG="$LOG" [ ! -z "$OPEN" ] && export OPEN="$OPEN" [ ! -z "$RMINPUT" ] && export RMINPUT="$RMINPUT" [ ! -z "$VERBOSE" ] && export VERBOSE="$VERBOSE" [ ! -z "$EXEC_VERBOSE" ] && export EXEC_VERBOSE="$EXEC_VERBOSE" [ ! -z "$COLOR" ] && export COLOR="$COLOR" [ ! -z "$GRAYSCALE" ] && export GRAYSCALE="$GRAYSCALE" [ ! -z "$LINEART" ] && export LINEART="$LINEART" [ ! -z "$NOPDF" ] && export NOPDF="$NOPDF" [ ! -z "$NODJVU" ] && export NODJVU="$NODJVU" return 0 } function directory_clean() { if [ ! -z $CLEAN ]; then if [ -z "$OUTDIR" ]; then echo 1>&2 $"outdir not set, try adding --outdir $HOME, closing now" exit 1 elif [ -e "$OUTDIR"/scanscript/ ]; then find $OUTDIR/scanscript/ -mindepth 1 -type f -exec rm $VERBOSE '{}' \; fi fi } function check_startcount() { if [ ! -z "$RESUME" ]; then startcount=${RESUME} echo "counter: $startcount" > "$LOG" elif [ -e "$LOG" ]; then input=$(head -n 1 "$LOG") input=${input##*: } startcount=${input} [ -z "$startcount" ] && startcount=1 && echo "counter: $startcount" > "$LOG" else startcount=1 echo "counter: $startcount" > "$LOG" fi if [ -n "$startcount" ]; then echo $"startcount: $startcount" else echo 1>&2 $"startcount is not detected, closing now" exit 1 fi if [ $(echo "$SOURCE" | tr [:upper:] [:lower:]) == "flatbed" ]; then EXTRA="--end-count $startcount" fi if [ -z $VERBOSE ]; then EXEC_VERBOSE="2>/dev/null" else unset EXEC_VERBOSE fi } function scanner_search() { echo $"searching for scanadf scanners and there options, please standby ..." scanadf --verbose --help } function scanner_lineart() { get_configuration lineart directory_clean setup_environment check_startcount echo $"lineart: yes" echo $"device: $DEVICE" echo $"outdir: $OUTDIR/scanscript/" echo $"log: $LOG" echo $"source: $SOURCE" echo $"resolution: $RESOLUTION" echo $"scanning of document has started, please standby ..." scan_busy_set scanadf $VERBOSE --device-name $DEVICE --scan-script "$COMMAND" --output-file "$OUTDIR"/scanscript/input/image-%04d.pbm --source $SOURCE --resolution $RESOLUTION --mode Lineart --compression None -x 210.000mm -y 297.000mm --start-count "$startcount" $EXTRA $EXEC_VERBOSE scan_busy_unset } function scanner_color() { get_configuration color directory_clean setup_environment check_startcount echo $"color: yes" echo $"device: $DEVICE" echo $"outdir: $OUTDIR/scanscript/" echo $"log: $LOG" echo $"source: $SOURCE" echo $"resolution: $RESOLUTION" echo $"scanning of document has started, please standby ..." scan_busy_set scanadf $VERBOSE --device-name $DEVICE --scan-script "$COMMAND" --output-file "$OUTDIR"/scanscript/input/image-%04d.pbm --source $SOURCE --resolution $RESOLUTION --mode Color -x 210.000mm -y 297.000mm --start-count "$startcount" $EXTRA $EXEC_VERBOSE scan_busy_unset } function scanner_grayscale() { get_configuration grayscale directory_clean setup_environment check_startcount echo $"grayscale: yes" echo $"device: $DEVICE" echo $"outdir: $OUTDIR/scanscript/" echo $"log: $LOG" echo $"source: $SOURCE" echo $"resolution: $RESOLUTION" echo $"scanning of document has started, please standby ..." scan_busy_set scanadf $VERBOSE --device-name $DEVICE --scan-script "$COMMAND" --output-file "$OUTDIR"/scanscript/input/image-%04d.pbm --source $SOURCE --resolution $RESOLUTION --mode Gray -x 210.000mm -y 297.000mm --start-count "$startcount" $EXTRA $EXEC_VERBOSE scan_busy_unset } check_dependencies if [ ! -z $CONFIG ]; then get_configuration; fi if [ ! -z $LINEART ]; then scanner_lineart; elif [ ! -z $COLOR ]; then scanner_color; elif [ ! -z $GRAYSCALE ]; then scanner_grayscale; elif [ ! -z $CLEAN ]; then directory_clean; elif [ ! -z $SEARCH ]; then scanner_search; elif [ -z $CLEAN ]; then echo 1>&2 $"pct-scanner-script: configuration variables not found, exiting now" exit 1 fi process_busy_scan; echo $"processing: completed, closing now" exit pct-scanner-scripts-0.0.4.orig/50configuration0000600000175000017500000000225111164466060020257 0ustar jellejelle# pct-scanner-script --lineart --config unit0 # lineart-unit0] # DEVICE=net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC # COMMAND="/$HOME/.scripts/scanner/myown-pct-scanner-script-process" # SOURCE=Flatbed # SOURCE=ADF # RESOLUTION=600 # OUTDIR=${HOME} # LOG="$OUTDIR/scanscript/output/status.log" # CLEAN=1 # pct-scanner-script --color --config unit0 # [color-unit0] # DEVICE=net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC # SOURCE=ADF # RESOLUTION=600 # OUTDIR=${HOME} # OPEN=$(which evince) # NODJVU=1 # NOPDF=1 # CLEAN=1 # pct-scanner-script --config lineart1 [lineart1] LINEART=1 DEVICE=net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC SOURCE=Flatbed RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) # pct-scanner-script --config grayscale1 [grayscale1] GRAYSCALE=1 DEVICE=net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC SOURCE=Flatbed RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) # pct-scanner-script --config color1 [color1] COLOR=1 DEVICE=net:192.168.1.1:hpaio:/usb/Officejet_J5700_series?serial=CN7BOCF3HP04TC SOURCE=Flatbed RESOLUTION=600 OUTDIR=${HOME} OPEN=$(which evince) pct-scanner-scripts-0.0.4.orig/pct-scanner-script.10000600000175000017500000000466311164466060021132 0ustar jellejelle.\" Hey, EMACS: -*- nroff -*- .\" First parameter, NAME, should be all caps .\" Second parameter, SECTION, should be 1-8, maybe w/ subsection .\" other parameters are allowed: see man(7), man(1) .TH PCT-SCANNER-SCRIPT 1 "March 31, 2009" .\" Please adjust this date whenever revising the manpage. .\" man --warnings -l pct-scanner-script.1 .\" .\" Some roff macros, for reference: .\" .nh disable hyphenation .\" .hy enable hyphenation .\" .ad l left justify .\" .ad b justify to both left and right margins .\" .nf disable filling .\" .fi enable filling .\" .br insert line break .\" .sp insert n+1 empty lines .\" for manpage-specific macros, see man(7) .SH NAME pct-scanner-script \- easy scan and create merged DjVu and PDF documents for archiving .SH SYNOPSIS .B pct-scanner-script .RI [ --help ] .br .SH DESCRIPTION \fBpct-scanner-script\fP is a bash script and configuration system to easy scan documents and create a digital archiving. It can create DjVu PDF and JPEG outputs, in merged and single files. It also has a configuration system where different configurations can be defined, this makes it easy to switching between configurations. .PP Please use .B pct-scanner-script --help to find all program options, the complete help, and all examples. .PP .\" TeX users may be more comfortable with the \fB\fP and .\" \fI\fP escape sequences to invode bold face and italics, .\" respectively. .PP .B Features: - auto archiving, in merged and singe DjVu, PDF, and JPEG files - auto and manual resume when scanning somehow fails - cascading configuration system, for easy customizing - easy command line style bash program, with useful options - archiving made possible with both adf and normal scanners - build for productivity and daily use - uses bash, scanadf and other mainstream processing tools - multilanguage commandline output .SH OPTIONS .TP .B \-h, \-\-help, \-? Show summary of options, help, and examples. .SH DEBUGGING This program is a helper script to easy scan and automated digital document archiving for normal and adf scanners. You can debug this script by running it as bash -x pct-scanner-script [options]. The script is just a nice wrapper for the scanadf, DjVu and PDF tools .SH SEE ALSO .BR scanadf (1), .br .SH AUTHOR .TP pct-scanner-script and this manual page are written by: .br Jelle de Jong . pct-scanner-scripts-0.0.4.orig/makefile0000600000175000017500000000121211164466060017014 0ustar jellejelle#!/usr/bin/make -f VERSION = "0.0.4" PROG_SCRIPTS = pct-scanner-script LIB_SCRIPTS = pct-scanner-script-process ALL_SCRIPTS = $(PROG_SCRIPTS) $(LIB_SCRIPTS) PROG_MAN = pct-scanner-script.1 ALL_MAN = $(PROG_MAN) PROG_CONF = pct-scanner-script.conf PROG_CONF_EXTRA = 50configuration ALL_CONF = $(PROG_CONF) $(PROG_CONF_EXTRA) DIST_FILES = readme DIST_FILES += todo DIST_FILES += notes DIST_FILES += changelog DIST_FILES += makefile ALL_FILES = $(ALL_SCRIPTS) $(ALL_MAN) $(ALL_CONF) ALL_FILES += $(DIST_FILES) all: for SCRIPT in $(ALL_SCRIPTS) ; \ do \ sed -i "/^version=/s/v.*/version=\"$(VERSION)\"/" $$SCRIPT ; \ done .phony: all pct-scanner-scripts-0.0.4.orig/README0000644000175000017500000000300011164466060016201 0ustar jellejelle2009-03-31 20:50 README Page 1 # Company: PowerCraft Technology # Author: Copyright Jelle de Jong # Note: Please send me an email if you enhanced this document # Version: 0.0.1 # Date: 2009-03-31 # This document is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This document is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. ------------------------------------------------------------------------ # example of xbindkeys system: layer-scanner-xbindkeysrc.scm ; scannen lineart (xbindkey '(Mod4 l) "/usr/bin/x-terminal-emulator -e /usr/bin/pct-scanner-script --lineart") ; scannen grayscale (xbindkey '(Mod4 g) "/usr/bin/x-terminal-emulator -e /usr/bin/pct-scanner-script --grayscale") ; scannen color (xbindkey '(Mod4 c) "/usr/bin/x-terminal-emulator -e /usr/bin/pct-scanner-script --color") ------------------------------------------------------------------------ pct-scanner-scripts-0.0.4.orig/localization0000600000175000017500000001377311164466060017746 0ustar jellejelle# Tue Feb 24 19:59:40 CET 2009 # http://mywiki.wooledge.org/BashFAQ/098 # localization: http://pgas.freeshell.org/mirror/ABSlocalization.html http://www.linuxtopia.org/online_books/advanced_bash_scripting_guide/localization.html # gettext http://www.gnu.org/software/gettext/manual/html_node/index.html # step 1: update your strings # before translation function version() { echo "Usage: $0 --help" echo "Version: $version" echo "Author: $author" echo "Donation: $donation" } # after translation function version() { echo $"Usage: $0 --help" echo $"Version: $version" echo $"Author: $author" echo $"Donation: $donation" } # step 2: create some sort of structure for your source mkdir --parent --verbose locale/nl/LC_MESSAGES/ mkdir --parent --verbose lang # step 3: check the strings bash -D pct-scanner-script bash -D pct-scanner-script-process # step 4: dump po strings to your directory bash --dump-po-strings pct-scanner-script > lang/pct-scanner-script-nl.pot bash --dump-po-strings pct-scanner-script-process > lang/pct-scanner-script-process-nl.pot # step 5: try to merge existing po with new updates # remove duplicated strings by hand or with sed or something else # awk '/^msgid/&&!seen[$0]++;!/^msgid/' lang/nl.pot > lang/nl.pot.new msgmerge lang/nl.po lang/nl.pot # step 5.1: try to merge existing po with new updates cp --verbose lang/pct-scanner-script-nl.po lang/pct-scanner-script-nl.po.old awk '/^msgid/&&!seen[$0]++;!/^msgid/' lang/pct-scanner-script-nl.pot > lang/pct-scanner-script-nl.pot.new msgmerge lang/pct-scanner-script-nl.po.old lang/pct-scanner-script-nl.pot.new > lang/pct-scanner-script-nl.po # step 5.2: try to merge existing po with new updates touch lang/pct-scanner-script-process-nl.po lang/pct-scanner-script-process-nl.po.old awk '/^msgid/&&!seen[$0]++;!/^msgid/' lang/pct-scanner-script-process-nl.pot > lang/pct-scanner-script-process-nl.pot.new msgmerge lang/pct-scanner-script-process-nl.po.old lang/pct-scanner-script-process-nl.pot.new > lang/pct-scanner-script-process-nl.po # step 6: create .mo file msgfmt -o locale/nl/LC_MESSAGES/pct-scanner-script.mo lang/pct-scanner-script-nl.po msgfmt -o locale/nl/LC_MESSAGES/pct-scanner-script-process.mo lang/pct-scanner-script-process-nl.po # step 7: move single .mo file to system locales sudo cp --verbose locale/nl/LC_MESSAGES/pct-scanner-script.mo /usr/share/locale/nl/LC_MESSAGES/ sudo chown root:root /usr/share/locale/nl/LC_MESSAGES/pct-scanner-script.mo sudo chmod 644 /usr/share/locale/nl/LC_MESSAGES/pct-scanner-script.mo sudo ls -hal /usr/share/locale/nl/LC_MESSAGES/pct-scanner-script.mo # step 8: move all .mo files to system locales sudo cp --verbose --recursive locale/* /usr/share/locale/ sudo chown root:root /usr/share/locale/nl/LC_MESSAGES/pct-scanner-*.mo sudo chmod 644 /usr/share/locale/nl/LC_MESSAGES/pct-scanner-*.mo sudo ls -hal /usr/share/locale/nl/LC_MESSAGES/pct-scanner-*.mo # step 9: add the following to you bash script under #!/bin/bash TEXTDOMAINDIR=/usr/share/locale TEXTDOMAIN=pct-scanner-script # step 10: start testing LANG=nl_NL bash pct-scanner-script --version LANG=en_GB bash pct-scanner-script --version ------------------------------------------------------------------------ # sudo dpkg-reconfigure locales export LANG=en_GB export TEXTDOMAINDIR=/usr/share/locale export TEXTDOMAIN=pct-scanner-script echo $"lineart: yes" echo $"color: yes" echo $"source: $SOURCE" echo $"testing" LANG=nl_NL TEXTDOMAINDIR=/usr/share/locale TEXTDOMAIN=pct-scanner-script echo $"lineart: yes" echo $"color: yes" echo $"source: $SOURCE" echo $"testing" ------------------------------------------------------------------------ jelle@debian-eeepc:~/packages-checkout/source/pct-scanner-scripts/pct-scanner-scripts-devel$ LANG=nl_NL jelle@debian-eeepc:~/packages-checkout/source/pct-scanner-scripts/pct-scanner-scripts-devel$ bash pct-scanner-script --version Gebruik: pct-scanner-script --help Versie: 0.0.5 Maker: Jelle de Jong Donatie: http://www.tuxcrafter.net/pages/contact.html#paypal-donation jelle@debian-eeepc:~/packages-checkout/source/pct-scanner-scripts/pct-scanner-scripts-devel$ jelle@debian-eeepc:~/packages-checkout/source/pct-scanner-scripts/pct-scanner-scripts-devel$ LANG=en_GB jelle@debian-eeepc:~/packages-checkout/source/pct-scanner-scripts/pct-scanner-scripts-devel$ bash pct-scanner-script --version Usage: pct-scanner-script --help Version: 0.0.5 Author: Jelle de Jong Donation: http://www.tuxcrafter.net/pages/contact.html#paypal-donation jelle@debian-eeepc:~/packages-checkout/source/pct-scanner-scripts/pct-scanner-scripts-devel$ ------------------------------------------------------------------------ jelle@debian-eeepc:~$ export LANG=en_GB jelle@debian-eeepc:~$ export TEXTDOMAINDIR=/usr/share/locale jelle@debian-eeepc:~$ export TEXTDOMAIN=pct-scanner-script jelle@debian-eeepc:~$ echo $"lineart: yes" lineart: yes jelle@debian-eeepc:~$ echo $"color: yes" color: yes jelle@debian-eeepc:~$ echo $"source: $SOURCE" source: jelle@debian-eeepc:~$ echo $"testing" testing jelle@debian-eeepc:~$ jelle@debian-eeepc:~$ LANG=nl_NL jelle@debian-eeepc:~$ TEXTDOMAINDIR=/usr/share/locale jelle@debian-eeepc:~$ TEXTDOMAIN=pct-scanner-script jelle@debian-eeepc:~$ echo $"lineart: yes" lineart: ja jelle@debian-eeepc:~$ echo $"color: yes" kleur: ja jelle@debian-eeepc:~$ echo $"source: $SOURCE" bron: jelle@debian-eeepc:~$ echo $"testing" dit is een test jelle@debian-eeepc:~$ ------------------------------------------------------------------------ jelle@debian-eeepc:~$ sudo dpkg-reconfigure locales Generating locales (this might take a while)... en_GB.ISO-8859-1... done en_GB.ISO-8859-15... done en_GB.UTF-8... done nl_NL.ISO-8859-15@euro... done nl_NL.ISO-8859-1... done nl_NL.UTF-8... done Generation complete. jelle@debian-eeepc:~$ locale -a C dutch en_GB en_GB.iso88591 en_GB.iso885915 en_GB.utf8 nl_NL nl_NL@euro nl_NL.iso88591 nl_NL.iso885915@euro nl_NL.utf8 POSIX jelle@debian-eeepc:~$