Created
September 19, 2020 16:16
-
-
Save j4velin/a32f2fd355f5140538586f19d780d6cc to your computer and use it in GitHub Desktop.
Scans the given number of pages and moves the resulting pdf to the input directory for the ocr.sh script
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/bash | |
count=$1 | |
resolution=150 | |
cd /home/pi/scans | |
if [ $count -gt 1 ] | |
then | |
scanimage --batch=scan_%d.tiff --batch-count=$count --format=tiff --resolution $resolution --mode Gray | |
tiffcp scan_* scan.tiff | |
rm scan_* | |
else | |
scanimage --format=tiff --resolution $resolution --mode Gray >scan.tiff | |
fi | |
tiff2pdf -p A4 scan.tiff > scan.pdf | |
rm scan.tiff | |
mv scan.pdf ../scaninput/scan_$(date +'%d_%m_%y_%H_%M_%S').pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment