13
echo "Convert a range of pages into pngs."
15
echo " pdf2images.sh <file>.pdf <first page> <last page>"
19
function ___silent () {
24
function ___sanity_check () {
25
# Check that we have the tools needed.
26
___silent which pdftoppm
29
echo " Can't find tool \"pdftoppm\" (Required)."
33
___silent which optipng
35
echo " Can't find tool \"optpng\" (Not required)."
39
if [ $___SANITY -eq 0 ]; then
40
echo "Please install the missing tools."
46
function ___process () {
48
pdftoppm -f $___FIRST\
57
if [ $___HAS_OPTIPNG -eq 1 ]; then
58
optipng ${___FILE%%.*}*.png
62
function ___parse_args () {
76
echo "Nummber of arguments missmatch."
85
___parse_args $___ARGS