HP L7580 Support for Duplex Scanning
This may be the wrong support group, if so I apologise.
I am trying to use the duplex ADF on this device, but anything but the hpoj driver refuses to recognise it.
What I am trying to do is a console-based scan to pdf to get rid of paper clutter. I tried gscand2pdf, but it's too interactive and doesn't recognise the ADF is duplex-capable, either.
HPLIP calls xscanimage to do a scan. It appears AFAIK to use hpaio. So assuming that scanimage should work I have built a BASH script around this.
Result of scanimage -L
device `hpoj:hpjd:
device `hpaio:
Result of scanimage -d hpoj:hpjd:
Usage: scanimage [OPTION]...
Start image acquisition on a scanner device and write PNM image data to
standard output.
Parameters are separated by a blank from single-character options (e.g.
-d epson) and by a "=" from multi-character options (e.g. --device-
-d, --device-
--format=
-i, --icc-profile=
-L, --list-devices show available scanner devices
-f, --formatted-
-b, --batch[=FORMAT] working in batch mode, FORMAT is `out%d.pnm' or
--batch-start=# page number to start naming files with
--batch-count=# how many pages to scan in batch mode
--batch-
--batch-double increment page number by two for 2sided originals
--batch-prompt ask for pressing a key before scanning a page
--accept-
-p, --progress print progress messages
-n, --dont-scan only set options, don't actually scan
-T, --test test backend thoroughly
-h, --help display this help message and exit
-v, --verbose give even more status messages
-B, --buffer-size change default input buffersize
-V, --version print version information
Options specific to device `hpoj:hpjd:
Scan mode:
--mode Lineart|
Selects the scan mode (e.g., lineart,monochrome, or color).
--resolution 75..2400dpi [75]
Sets the resolution of the scanned image.
Advanced:
--contrast 0..100 [inactive]
Controls the contrast of the acquired image.
--compression None|JPEG [None]
Selects the scanner compression method for faster scans, possibly at
the expense of image quality.
--jpeg-
Sets the scanner JPEG compression factor. Larger numbers mean better
--batch-
Guarantees that a "no documents" condition will be returned after the
last scanned page, to prevent endless flatbed scans after a batch scan.
For some models, option changes in the middle of a batch scan don't
take effect until after the last page.
--source Auto|Flatbed|ADF [Auto]
Selects the desired scan source for models with both flatbed and
automatic document feeder (ADF) capabilities. The "Auto" setting means
that the ADF will be used if it's loaded, and the flatbed (if present)
will be used otherwise.
--duplex[
Enables scanning on both sides of the page for models with
duplex mode, one side will be scanned upside-down. This feature is
Geometry:
--length-
Selects how the scanned image length is measured and reported, which
is impossible to know in advance for scrollfed scans.
-l 0..215.9mm [0]
Top-left x position of scan area.
-t 0..381mm [0]
Top-left y position of scan area.
-x 0..215.9mm [215.9]
Width of scan-area.
-y 0..381mm [381]
Height of scan-area.
Type ``scanimage --help -d DEVICE'' to get list of all options for DEVICE.
List of available devices:
hpoj:
hpaio:
With hpoj I can perform a duplex scan sometimes, but sometimes it just loops feeding the same sheet in and out of the ADF so that instead of getting two scans per page it keeps going until I kill it.
I want to use the hplip driver as much as possible.
Here is my script if anyone is interested:
-------
#!/bin/bash
#(Mostly) non-interactive scan to pdf
#Requires sane, imagemagick, and pdftk
function process_scan
{
# parallel OCR and conversion to postscript (dual core)
gocr $1.pnm > $1.txt & I=$!
convert -page a4 $1.pnm $1.ps & J=$!
wait $I $J $K
# parallel pdf creation from image and ocr text
ps2pdf -sPAPERSIZE=a4 $1.ps $1.pdf & I=$!
a2ps -M A4 $1.txt -o text$1.ps
ps2pdf -sPAPERSIZE=a4 text$1.ps text$1.pdf & J=$!
wait $I $J
}
D=scand$$
mkdir $D
cd $D
M=`date "+%Y-%m (%b)"`
dest="/
SIDES=""
DUPLEX=""
while test "$SIDES" != "D" -a "$SIDES" != "S"
do
echo -n "Duplex (D) or Single-sided (S)? [D] "
read SIDES
echo $SIDES
if test -z "$SIDES" -o "$SIDES" = "D"
then
SIDES=D
DUPLEX=
fi
done
#Scan in the pages
#Creates outn.pnm for each page
scanimage --device-
-x 210 --compression=
--batch --progress $DUPLEX > image.tif
i=1; while test -f out$i.pnm
do
# if duplex scan, even numbered scans are upside down - put them right otherwise OCR fails
if test "$SIDES" = "D" -a $[i%2] -eq 0
then
mv out$i.pnm out${i}a.pnm
convert -rotate 180 out${i}a.pnm out$i.pnm
rm out${i}a.pnm
fi
process_scan out$i
((i++))
done
pdftk out*.pdf text*.pdf cat output scan.pdf
if test ! -f scan.pdf
then
exit 1
fi
mkdir -p "$dest"
i=1; j=000$i
while test -f "$dest/scan${j: -4}.pdf"
do
((i++))
j=000$i
done
cp scan.pdf "$dest/scan${j: -4}.pdf"
cd ..
echo "removing temporary directory $D"
rm -r $D
exit 0
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- HPLIP Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask seagull for more information if necessary.