Created
July 29, 2015 07:50
-
-
Save ragusa87/1640c57792f2c14cf265 to your computer and use it in GitHub Desktop.
Rotate pdf left with pdftk
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 | |
if [ "$#" -ne 1 ]; then | |
echo "Usage: $0 filename" | |
exit 1; | |
fi | |
if [ ! -f $1 ]; then | |
echo "File not found!" | |
exit 2 | |
fi | |
mv $1 $1.tmp | |
pdftk $1.tmp cat 1-endleft output $1 | |
if [ $? -eq 0 ]; then | |
rm $1.tmp | |
else | |
mv $1.tmp $1 | |
echo "Error" | |
exit 3 | |
fi | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if pdftk is not available, use qpdf instead:
qpdf --rotate=+180:1-z $1.tmp $1