Skip to content

Instantly share code, notes, and snippets.

@zelinskiy
Created August 23, 2019 15:01
Show Gist options
  • Save zelinskiy/9b784f0ce1bd8f4f6244a08a1f407ad5 to your computer and use it in GitHub Desktop.
Save zelinskiy/9b784f0ce1bd8f4f6244a08a1f407ad5 to your computer and use it in GitHub Desktop.
#!/bin/bash
COUNTER=1
PAGES=1168
while [ $COUNTER -lt $PAGES ]; do
TO=$((COUNTER+100))
if [ $TO -gt $PAGES ]
then
let TO=$PAGES
fi
/snap/bin/pdftk Breviarium.pdf cat $COUNTER-$TO output breviarium/Breviarium$COUNTER-$TO.in.pdf
convert -density 600 -threshold 61% breviarium/Breviarium$COUNTER-$TO.in.pdf breviarium/Breviarium$COUNTER-$TO.out.pdf
echo $TO/$PAGES
let COUNTER=$((TO+1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment