From 7c3abea2320d4291d379e210811ed5034d656e0c Mon Sep 17 00:00:00 2001 From: fritz-hh Date: Thu, 18 Apr 2013 10:43:28 +0200 Subject: [PATCH] OCRmyPDF.sh: page number now with leading zeros --- OCRmyPDF.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/OCRmyPDF.sh b/OCRmyPDF.sh index 87af9033..046bbb0e 100644 --- a/OCRmyPDF.sh +++ b/OCRmyPDF.sh @@ -24,6 +24,9 @@ echo "PDF file has $numpages pages" page="1" cat "$FILE_SIZEPAGES" | while read pageSize ; do + # add leading zeros to the page number + page=`printf "%04d" $page` + echo "Page $page: Computing embedded image resolution" # get width / height of PDF page heightPDF=`echo $pageSize | cut -f1 -d" "` @@ -84,7 +87,6 @@ done # concatenate all pages -# TODO pages are currently not concatenated in the right order due to their naming (e.g. 2.pdf after 10.pdf) pdftk ${tmp}/*-ocred.pdf cat output "${tmp}/ocred.pdf" # insert metadata