ambevar-dotfiles/.scripts/pdf2scan

23 lines
336 B
Bash
Executable File

#!/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"