Created
November 24, 2017 12:29
-
-
Save hlev/37f9a88e61b9d610b372c116f2b7fc78 to your computer and use it in GitHub Desktop.
Helper script to scan straight to PDF with network scanner on the LAN using scanimage and unoconv
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# usage: scan2pdf output | |
# results in: output.pdf | |
# possible improvements: | |
# - config file for IP, default resolution, sleep time | |
# - device discovery | |
# - platform-agnostic temp file usage | |
# - investigate parsing errors of otherwise successful conversions | |
tmpfile=$(mktemp /tmp/scan.XXXX); | |
scanimage -d 'smfp:net;<ip_of_scanner>' --resolution 150 > "$tmpfile" | |
sleep 6 | |
unoconv -o $1.pdf "$tmpfile" | |
rm "$tmpfile" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment