Raspberry Pi/Scan Server: Difference between revisions
No edit summary |
No edit summary |
||
Line 16: | Line 16: | ||
** apt-get install ghostscript libtiff-tools | ** apt-get install ghostscript libtiff-tools | ||
** tiff2pdf -o output.pdf input.tiff | ** tiff2pdf -o output.pdf input.tiff | ||
* /etc/scanbuttond/initscanner.sh (for Canon LIDE) | |||
<blockquote> | |||
<pre> | |||
#!/bin/sh | |||
sane-find-scanner | |||
scanimage -n | |||
</pre> | |||
</blockquote> | |||
* /etc/scanbuttond/buttonpressed.sh | |||
<blockquote> | |||
<pre> | |||
#!/bin/sh | |||
BUTTON="$1" | |||
DEVICE="$2" | |||
TMPDIR="/tmp/scanned" | |||
LOCKFILE="/tmp/${DEVICE}.lock" | |||
DATE=$(date +"%Y-%m-%d_%H-%M") | |||
if [ -f ${LOCKFILE} ] | |||
then | |||
echo "Error: Device already in use." | |||
fi | |||
touch ${LOCKFILE} | |||
mkdir -p ${TMPDIR} | |||
case ${BUTTON} in | |||
1) | |||
echo "button 1 has been pressed on ${DEVICE}" | |||
/etc/scanbuttond/button1.sh ${TMPDIR} ${DEVICE} | |||
echo "done" | |||
;; | |||
2) | |||
echo "button 2 has been pressed on ${DEVICE}" | |||
/etc/scanbuttond/button2.sh ${TMPDIR} ${DEVICE} | |||
echo "done" | |||
;; | |||
3) | |||
echo "button 3 has been pressed on ${DEVICE}" | |||
/etc/scanbuttond/button3.sh ${TMPDIR} ${DEVICE} | |||
echo "done" | |||
;; | |||
4) | |||
echo "button 4 has been pressed on ${DEVICE}" | |||
/etc/scanbuttond/button4.sh ${TMPDIR} ${DEVICE} | |||
echo "done" | |||
;; | |||
esac | |||
rm -f ${LOCKFILE} | |||
</pre> | |||
</blockquote> |
Revision as of 16:52, 20 May 2013
- scanbuttond with Canon LiDE 100
- source: http://wp.psyx.us/?p=500
- wget http://downloads.sourceforge.net/project/scanbuttond/scanbuttond/0.2.3/scanbuttond-0.2.3.tar.gz?r=&ts=1287554303&use_mirror=netcologne
- wget http://scanbuttond.sourcearchive.com/downloads/0.2.3.cvs20090713-2/scanbuttond_0.2.3.cvs20090713.orig.tar.gz
- untar
- cp scanbuttond-0.2.3.cvs20090713.orig\backends\genesys.* scanbuttond-0.2.3\backends\
- modify genesys.c
- edit Makefile.am
- edit meta.conf
- automake-1.9
- ./configure --prefix=/usr --sysconfdir=/etc
- make
- make install
- tiff2pdf
- apt-get install ghostscript libtiff-tools
- tiff2pdf -o output.pdf input.tiff
- /etc/scanbuttond/initscanner.sh (for Canon LIDE)
#!/bin/sh sane-find-scanner scanimage -n
- /etc/scanbuttond/buttonpressed.sh
#!/bin/sh BUTTON="$1" DEVICE="$2" TMPDIR="/tmp/scanned" LOCKFILE="/tmp/${DEVICE}.lock" DATE=$(date +"%Y-%m-%d_%H-%M") if [ -f ${LOCKFILE} ] then echo "Error: Device already in use." fi touch ${LOCKFILE} mkdir -p ${TMPDIR} case ${BUTTON} in 1) echo "button 1 has been pressed on ${DEVICE}" /etc/scanbuttond/button1.sh ${TMPDIR} ${DEVICE} echo "done" ;; 2) echo "button 2 has been pressed on ${DEVICE}" /etc/scanbuttond/button2.sh ${TMPDIR} ${DEVICE} echo "done" ;; 3) echo "button 3 has been pressed on ${DEVICE}" /etc/scanbuttond/button3.sh ${TMPDIR} ${DEVICE} echo "done" ;; 4) echo "button 4 has been pressed on ${DEVICE}" /etc/scanbuttond/button4.sh ${TMPDIR} ${DEVICE} echo "done" ;; esac rm -f ${LOCKFILE}