[sane-devel] SANE automation setup?
Wilhelm Meier
wilhelm.wm.meier at googlemail.com
Fri Nov 3 06:21:06 UTC 2017
Please post the full log, so that one can see the names of all options.
If the scanner supports a button (option) we will see the name of the
option in the log. Then one can adapt the config file to match the
option name and call a scan-script.
Am 02.11.2017 um 21:49 schrieb Adam Lloyd:
> Sorry about that.
>
> pi at raspberrypi:~ $ export SANE_CONFIG_DIR=/etc/scanbd
> pi at raspberrypi:~ $ scanbd -f
> scanbd: Can't set the effective gid to 116
> scanbd: Can't set the effective uid to 111
> scanbd: dbus match type='signal',interface='org.freedesktop.Hal.Manager'
> scanbd: Not Primary Owner (-1)
> scanbd: Name Error (Connection ":1.18" is not allowed to own the service
> "de.kmux.scanbd.server" due to security policies in the configuration file)
> scanbd: option[1] standard for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[5] geometry for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[10] enhancement for device rts8891:libusb:001:006 not of
> type BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[20] sensors for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[1] standard for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[5] geometry for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[10] enhancement for device rts8891:libusb:001:006 not of
> type BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[20] sensors for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[1] standard for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[5] geometry for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[10] enhancement for device rts8891:libusb:001:006 not of
> type BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[20] sensors for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[1] standard for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[5] geometry for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[10] enhancement for device rts8891:libusb:001:006 not of
> type BOOL|INT|FIXED|STRING|BUTTON. Skipping
> scanbd: option[20] sensors for device rts8891:libusb:001:006 not of type
> BOOL|INT|FIXED|STRING|BUTTON. Skipping
>
> pi at raspberrypi:~ $ scanimage --list-devices
> device `rts8891:libusb:001:006' is a Hewlett-Packard 4470c flatbed scanner
>
> here is the script that scandb is running -- (under the action section
> of the scanbd.conf file)
>
> #!/bin/bash
>
> OUT_DIR=~/scans/Today
> TMP_DIR=`mktemp -d`
> FILE_NAME=scan_`date +%Y-%m-%d-%H%M%S`
> LANGUAGE="eng" # the tesseract language - ensure you
> installed it
>
> echo 'scanning...'
> scanimage --resolution 300 \
> --batch="$TMP_DIR/scan_%03d.pnm" \
> --format=pnm \
> --mode Gray \
> --source 'ADF Front'
> echo "Output saved in $TMP_DIR/scan*.pnm"
>
> cd $TMP_DIR
>
> for i in scan_*.pnm; do
> echo "${i}"
> convert "${i}" "${i}.tif"
> done
>
> # do OCR
> echo 'doing OCR...'
> for i in scan_*.tif; do
> echo "${i}"
> tesseract "$i" "$i" -l $LANGUAGE hocr
> hocr2pdf -i "$i" -s -o "$i.pdf" < "$i.hocr"
> done
>
> # create PDF
> echo 'creating PDF...'
> pdftk *.tif.pdf cat output "compiled.pdf"
>
> gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook
> -dNOPAUSE -dQUIET -dBATCH -sOutputFile="$FILE_NAME.pdf" compiled.pdf
>
> cp $FILE_NAME.pdf $OUT_DIR/
>
> rm -rf $TMP_DIR
>
>
> On Thu, Nov 2, 2017 at 4:49 PM, Wilhelm Meier
> <wilhelm.wm.meier at googlemail.com
> <mailto:wilhelm.wm.meier at googlemail.com>> wrote:
>
> Please post the log as text, not as image ...
>
>
> Am 02.11.2017 um 17:21 schrieb Adam Lloyd:
> > Thanks Wilhelm.
> >
> > Here is the issue with my scandb setup.
> >
> > [IMG]http://i67.tinypic.com/2hqq7op.jpg[/IMG]
> <http://i67.tinypic.com/2hqq7op.jpg[/IMG]>
> >
> >
> > On Thu, Nov 2, 2017 at 12:06 PM, Wilhelm Meier
> > <wilhelm.wm.meier at googlemail.com <mailto:wilhelm.wm.meier at googlemail.com>
> > <mailto:wilhelm.wm.meier at googlemail.com
> <mailto:wilhelm.wm.meier at googlemail.com>>> wrote:
> >
> > You should have a look at scanbd:
> >
> > https://sourceforge.net/projects/scanbd/
> <https://sourceforge.net/projects/scanbd/>
> > <https://sourceforge.net/projects/scanbd/
> <https://sourceforge.net/projects/scanbd/>>
> >
> >
> >
> > Am 02.11.2017 um 16:19 schrieb Adam Lloyd:
> > > Hello,
> > >
> > > I recently moved an old scanner to a raspberry pi to see if I
> > could get
> > > it to work on alternative platform. A google search revealed
> that SANE
> > > has "good" support for my particular scanner. After a few
> attempts I
> > > managed to get Xsane working on a raspberry pi 3 running with
> > stretch. I
> > > was able to successfully scan a document! I would like to
> setup a dumb
> > > terminal station, where the scanner sits in a corner and is
> idle.
> > > Whenever some needs to scan a document they would hit the
> scan button
> > > and the document would get moved to our home NAS. I have
> attempted to
> > > get this setup working but without much luck.
> > >
> > > Thanks,
> > > Adam.
> > >
> > >
> >
> >
>
>
>
>
More information about the sane-devel
mailing list