HP Scan Cheatsheet
If you have an HP printer (which have great Linux support), and you have installed the hplip tool, you will have access to the hp-scan
tool, which will trigger a scanning job of your printer.
By default, the tool will scan quickly in greyscale to a file called hpscanXXX.png where XXX are a set of numbers to give a unique value.
I prefer to output in color, and a .jpg file instead, so the command I would use most frequently is:
hp-scan \
--mode=color \
--size=a4 \
--compression=jpeg
If you want it in grayscale, then you can do the following, but such a mode will not allow saving as a .jpg file.
hp-scan --mode=gray
Specify Output File
If you wish to specify where the file should be saved to, just add the --output
flag like so:
hp-scan \
--mode=color \
--compression=jpeg \
--output=my-file.jpg
Of course there is shorthand too:
hp-scan -m=color -x=jpeg -o=my-file.jpg
Emailing
If you want to send the image in an email, use the following:
hp-scan \
--mode=color \
--compression=jpeg \
---email-from=my-email@gmail.com \
--email-subject="subject here" \
--email-msg="Your scan is attached" \
--email-to="an-email@gmail.com"
References
First published: 30th June 2021