OCRmyPDF.sh: page number now with leading zeros

This commit is contained in:
fritz-hh 2013-04-18 10:43:28 +02:00
parent 2c23bca913
commit 7c3abea232

View File

@ -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