Lester Thorpe
2020-05-14 20:22:16 UTC
I just pulled an HP 6200C flatbed scanner out of storage.
Holy moley! This device is ancient, as far as scanners go.
But it has very good capabilities and I want to use it.
What options do I have? Let's consider them.
Microshit Winblows:
Ha, ha, ha, ha, ha! Tough luck asshole. We don't support
that old thing. You are a fool with your money, so just go
and buy a brand new scanner. We only support brand new
scanners. Asshole.
GNU/Linux:
Don't you worry. With a little knowledge and understanding,
GNU/Linux can do anything and everything.
SANE fully supports the HP6200C, and I mean FULLY.
The following script will scan a document in high res
grayscale, threshold to bi-tonal using the best parameters,
compress with the highly efficient JBIG2 algorithm, and
then produce a PDF.
Of course, you can archive the original high res grayscale
if desired, and do virtually any-fucking-thing else, by
a suitable adjustment of the script.
Step 1 -- discover all relevant scanner parameters with:
scanimage --help --device hp:libusb:major:minor
Step 2 -- program these into the bash script
Step 3 -- execute the bash script as follows:
doc2pdf.sh outputfile.pdf gamma major minor
===================================================
doc2pdf.sh for the HP6200C
===================================================
#! /bin/bash
# HP6200C
# scans to 12-bit 300dpi gray scale pgm
# doc2pdf.sh file.pdf gamma major minor
gamma=$2
outfile=$1
major=$3
minor=$4
scanimage -p -d hp:libusb:$major:$minor --format pnm --mode Gray --depth 12 \
--resolution 300 --speed="Normal" --output-8bit="no"\
--source Normal \
--custom-gamma="yes" \
--gamma-table `gamma4scanimage $gamma 0 255 255 255` \
| pamthreshold | pnmtopnm > ${outfile%.pdf}.pbm
jbig2 -s -p ${outfile%.pdf}.pbm > ${outfile%.pdf}.jb2
python pdf.py output > $outfile
========================================================================
All done!
Requirements: SANE, netpbm, jbig2enc
Holy moley! This device is ancient, as far as scanners go.
But it has very good capabilities and I want to use it.
What options do I have? Let's consider them.
Microshit Winblows:
Ha, ha, ha, ha, ha! Tough luck asshole. We don't support
that old thing. You are a fool with your money, so just go
and buy a brand new scanner. We only support brand new
scanners. Asshole.
GNU/Linux:
Don't you worry. With a little knowledge and understanding,
GNU/Linux can do anything and everything.
SANE fully supports the HP6200C, and I mean FULLY.
The following script will scan a document in high res
grayscale, threshold to bi-tonal using the best parameters,
compress with the highly efficient JBIG2 algorithm, and
then produce a PDF.
Of course, you can archive the original high res grayscale
if desired, and do virtually any-fucking-thing else, by
a suitable adjustment of the script.
Step 1 -- discover all relevant scanner parameters with:
scanimage --help --device hp:libusb:major:minor
Step 2 -- program these into the bash script
Step 3 -- execute the bash script as follows:
doc2pdf.sh outputfile.pdf gamma major minor
===================================================
doc2pdf.sh for the HP6200C
===================================================
#! /bin/bash
# HP6200C
# scans to 12-bit 300dpi gray scale pgm
# doc2pdf.sh file.pdf gamma major minor
gamma=$2
outfile=$1
major=$3
minor=$4
scanimage -p -d hp:libusb:$major:$minor --format pnm --mode Gray --depth 12 \
--resolution 300 --speed="Normal" --output-8bit="no"\
--source Normal \
--custom-gamma="yes" \
--gamma-table `gamma4scanimage $gamma 0 255 255 255` \
| pamthreshold | pnmtopnm > ${outfile%.pdf}.pbm
jbig2 -s -p ${outfile%.pdf}.pbm > ${outfile%.pdf}.jb2
python pdf.py output > $outfile
========================================================================
All done!
Requirements: SANE, netpbm, jbig2enc