4
# FILE NAME pdf2images.sh
7
# Gustav Hartvigsson 2024
8
# Distributed under the Cool Licence 1.1
24
__SCRIPT_ROOT=$(dirname $(readlink -f $0))
25
source $__SCRIPT_ROOT/useful.inc.sh
28
echo "pdf2images.sh --- Convert a range of pdf pages into pngs."
30
echo " pdf2images.sh <file>.pdf <first page> <last page>"
34
function __sanity_check () {
35
# Check that we have the tools needed.
38
__silent which optipng
40
echo " Can't find tool \"optpng\" (Not required)."
44
if [[ $__SANITY == false ]]; then
46
echo "Please install the missing tools."
52
function __process () {
63
if [[ $__HAS_OPTIPNG == true ]]; then
64
optipng ${__FILE%%.*}*.png
68
function __parse_args () {
82
echo "Nummber of arguments missmatch."