Initial reports:
Printer works just fine, at least as much as I have needed it to date. Duplex printing works great.
The scanner works with hplip installed, but one page at a time. All I want is to scan in multi-page documents and convert to pdf. I tried skanlite, simple-scan, hp's scan interface from hplip (see hp-systray), xsane, and gscan2pdf.
gscan2pdf looks most promising. But it is stymied by an image corruption problem somewhere upstream. Also, the auto document feeder does not seem to send an end of document notification so gscan2pdf keeps scanning air for a couple of pages before erroring out. I expect both these problems to be fixed, but until then, I have a work around ...
Here is a script I have tested to convert a multi-page document into a single pdf. Save it as /usr/local/bin/scan-base and sudo ln -s /usr/local/bin/scan-base /usr/local/bin/scan-pdf. Then just type scan-pdf into a terminal whenever you want to create a pdf document. It will drop the image into your home directory. You will need to adjust the --device-name parameter to that provided by HPLIP. The reason why this works and gscan2pdf doesn't is I am using the tiff format for scan images. The default pbm format appears to be what is used by gscan2pdf, and that cannot be processed by convert. You need imagemagick and ghostscript installed at least for this script to work.
Code:
#!/bin/bash
# This stop on first error; unfortunately convert complains
# so we can not use it at present (scanimage output images have errors)
# set -e;
# This complains if we try to use unset variables.
set -u;
INVOKE=`basename "$0"` # can be scan-copy; scan-pdf; scan-copy-pdf; scan-pnm
USER=`whoami` # user
PROCESSID=$$ # process id for uniqueness
DATETIME=`date +%Y%m%d_%H%M%S`
TMPDIR="/tmp/scan_${USER}_${DATETIME}_${PROCESSID}"
PDFILE="$HOME/scan_${DATETIME}_${PROCESSID}.pdf"
if [ ! -d "${HOME}" ] || [ ! -x "${HOME}" ] || [ ! -d "${HOME}" ]; then
echo "${INVOKE}: \$HOME environment variable does not appear to"
echo "${INVOKE}: be properly set. Make sure it points to your"
echo "${INVOKE}: home directory, e.g. type: export HOME='/home/me'."
echo "${INVOKE}: Exiting."
exit 0
fi
function MKTMP {
if [ -a "${TMPDIR}" ]; then
echo "Temporary directory for scan already exists!"
echo " ( ${TMPDIR} )"
echo " ABORTING!"
exit 0
fi
mkdir -p "${TMPDIR}"
if [ ! -r "${TMPDIR}" ]; then
echo "Cannot create temporary directory for scan!"
echo " ( $TMPDIR )"
echo " ABORTING!"
exit 0
fi
}
function SCANIT () {
echo -n "How many pages? ";
read count;
# TODO See scanimage -L to get list of devices.
# May wish to have user select on start
/usr/bin/scanimage \
--device-name='hpaio:/net/Officejet_Pro_8600?ip=192.168.1.2' \
-l 0 -t 0 -x 215.9 -y 279.4 \
--source=ADF --batch=scan%02d.tiff --batch-count ${count} \
--format=tiff --mode=color --resolution=300;
}
function CONVERTIT () {
convert -density 300x300 -geometry 2550x3300 *.tiff out.ps;
ps2pdf out.ps out.pdf;
}
function PRINTIT () {
ls *.pnm |while read -r LINE
do
BASE=`basename "${LINE}" ".pnm"`;
convert "${LINE}" "${BASE}.ps";
lpr -P hp8600 "${BASE}.ps";
done
}
function CLEANUP () {
if [ -r "out.pdf" ]; then
mv out.pdf "${PDFILE}"
fi
cd "${HOME}"
rm -rf "${TMPDIR}"
}
case $INVOKE in
scan-copy)
MKTMP; cd "${TMPDIR}"; SCANIT; PRINTIT; CLEANUP
;;
scan-pdf)
MKTMP; cd "${TMPDIR}"; SCANIT; CONVERTIT; CLEANUP
;;
scan-copy-pdf)
MKTMP; cd "${TMPDIR}"; SCANIT; CONVERTIT; CLEANUP
;;
scan-img)
MKTMP; cd "${TMPDIR}"; SCANIT
cd "${HOME}"; mv "${TMPDIR}" ./ ;;
*)
echo "command $INVOKE not supported by scan-simple"
;;
esac
exit 0
Bookmarks