Last active
December 27, 2015 06:09
-
-
Save elektret/7280051 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# You need: cuneiform hocr2pdf pdfunite | |
FILES=$@ | |
merged="" | |
index=0 | |
for file in $FILES | |
do | |
index=`expr $index + 1` | |
page=`printf page%03d.hocr $index` | |
cuneiform -l ger -f hocr -o "${page}" "${file}" | |
done | |
index=0 | |
for file in $FILES | |
do | |
index=`expr $index + 1` | |
page=`printf page%03d.hocr $index` | |
output=`printf out%03d.pdf $index` | |
merged="${merged} ${output}" | |
hocr2pdf -i "${file}" -o "${output}" < $page | |
done | |
pdfunite $merged merged.pdf | |
rm -rf *.hocr | |
rm -rf out*.pdf |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment