feat: scanpdf, bash optimizations
This commit is contained in:
parent
0ea2a49df1
commit
484cc80fbd
3 changed files with 21 additions and 3 deletions
18
bin/scanpdf
Executable file
18
bin/scanpdf
Executable file
|
@ -0,0 +1,18 @@
|
|||
#!/usr/bin/bash
|
||||
set -e
|
||||
|
||||
usage() {
|
||||
echo -e "USAGE: $0 FILE.pdf"
|
||||
exit 0
|
||||
}
|
||||
|
||||
DEVICE='pixma:04A9178A_31A16C'
|
||||
FORMAT='png'
|
||||
RES=300
|
||||
|
||||
if [ "$1" == '-h' ] || [[ "$1" != *.pdf ]]; then
|
||||
usage
|
||||
fi
|
||||
|
||||
scanimage -d "$DEVICE" --format="$FORMAT" --resolution "$RES" > "$1"
|
||||
convert "$1" "$1"
|
Loading…
Add table
Add a link
Reference in a new issue