Created
January 5, 2013 17:59
-
-
Save hawx/4462794 to your computer and use it in GitHub Desktop.
Takes a pdf, splits pages in half horizontally, rotates them, then glues them together into a pdf.
This file contains hidden or 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
# Usage: sh splitconv.sh "some.pdf" | |
echo "Making temporary directory..." | |
mkdir "splitconv-tmp" | |
echo "Splitting pdf..." | |
convert -size 1x2@ "$1" "splitconv-tmp/split.png" | |
echo "Rotating pages..." | |
convert -rotate 270 "tmp-tmp-tmp/split-*.png" "splitconv-tmp/rot.png" | |
echo "Creating done.pdf..." | |
convert -page a5 "tmp-tmp-tmp/rot-*.png" done.pdf | |
rm -rf "splitconv-tmp" | |
echo "Finished." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment