scripts/pdf2scan: Init

master
Pierre Neidhardt 2015-12-06 15:40:12 +11:00
parent e426e65a5c
commit 6ceae4c1b9
1 changed files with 22 additions and 0 deletions

22
.scripts/pdf2scan Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
if [ $# -ne 2 ]; then
cat<<EOF
Usage: ${0##*/} INPUT OUTPUT
Convert a PDF to a blurred, black & white raster image.
EOF
exit
fi
if [ ! -f "$1" ]; then
echo "$1 is not a valid file."
exit
fi
if [ -e "$2" ]; then
echo "$2 exists."
exit
fi
convert -threshold 90% -blur 1x1 -quality 100 -flatten -density 400 "$1" "$2"