4
# FILE NAME pdf2images.sh
21
echo "pdf2images.sh --- Convert a range of pdf pages into pngs."
23
echo " pdf2images.sh <file>.pdf <first page> <last page>"
27
function __silent () {
32
function __sanity_check () {
33
# Check that we have the tools needed.
34
__silent which pdftoppm
37
echo " Can't find tool \"pdftoppm\" (Required)."
41
__silent which optipng
43
echo " Can't find tool \"optpng\" (Not required)."
47
if [[ $__SANITY == false ]]; then
48
echo "Please install the missing tools."
54
function __process () {
65
if [[ $__HAS_OPTIPNG == true ]]; then
66
optipng ${__FILE%%.*}*.png
70
function __parse_args () {
84
echo "Nummber of arguments missmatch."