Last active
October 13, 2015 16:41
-
-
Save morbidick/11195604 to your computer and use it in GitHub Desktop.
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
#!/bin/sh | |
outname=$1 | |
startdir=$(pwd) | |
timestamp=$(date +"%s") | |
tmpdir="scan-$timestamp" | |
cd /tmp | |
mkdir $tmpdir | |
cd $tmpdir | |
echo "################## Scanning ###################" | |
#mode can be Lineart, Gray or Color | |
scanimage --batch=out%d.tif --batch-prompt --format=tiff --mode Gray --resolution 300 | |
echo "############## Converting to PDF ##############" | |
#Use tiffcp to combine output tiffs to a single mult-page tiff | |
tiffcp -c lzw out*.tif output.tif | |
#Convert the tiff to PDF | |
tiff2pdf -j -o $startdir/$outname output.tif | |
echo "################ Cleaning Up ################" | |
cd .. | |
rm -rf $tmpdir | |
cd $startdir |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment