Skip to content
Snippets Groups Projects

Replaced pdfimages with pdftoppm

Merged Tim Schroeder requested to merge (removed):use-pdftoppm-instead-of-pdfimages into master
2 files
+ 36
15
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 13
3
@@ -21,6 +21,7 @@ Options:
-o, --out output folder containing passwords.csv and moodle_feedbacks.zip. Default: ./out
-p, --password sets global password. Default: empty, such that each PDF gets a custom password generated with 'pwgen'
--cores number of cores for watermarking. Default: 1
-d, --dpi dpi parameter for conversion from pdf to images. Default: 250
-q, --quality quality parameter for jpeg. Default: 25
-t, --tmp tmp folder. Default: ./tmp"
@@ -32,8 +33,8 @@ if [[ ${PIPESTATUS[0]} -ne 4 ]]; then
exit 1
fi
OPTIONS=hi:c:o:p:q:t:v
LONGOPTS=help,in:,csv:,out:,password:,cores:,quality:,tmp:,verbose
OPTIONS=hi:c:o:p:d:q:t:v
LONGOPTS=help,in:,csv:,out:,password:,cores:,dpi:,quality:,tmp:,verbose
# -regarding ! and PIPESTATUS see above
# -temporarily store output to be able to check for errors
@@ -48,7 +49,7 @@ fi
# read getopt’s output this way to handle the quoting right:
eval set -- "$PARSED"
infolder=- csv=- outfolder=- cores=- quality=- tmpfolder=- v=n password=-
infolder=- csv=- outfolder=- cores=- dpi=- quality=- tmpfolder=- v=n password=-
# now enjoy the options in order and nicely split until we see --
while true; do
case "$1" in
@@ -76,6 +77,10 @@ while true; do
cores="$2"
shift 2
;;
-d|--dpi)
dpi="$2"
shift 2
;;
-q|--quality)
quality="$2"
shift 2
@@ -126,6 +131,11 @@ if [[ $cores = "-" ]]; then
cores=1
fi
if [[ $dpi = "-" ]]; then
# global password not given, use distinct password for each pdf
dpi=250
fi
if [[ $quality = "-" ]]; then
# global password not given, use distinct password for each pdf
quality=2
Loading