A short script to rotate pdf files.
Uses python with the argparse and pyPdf modules.
Most pdf viewers allow to rotate pdf files, but only until you close the file.
This script writes a new pdf file from an existing one, applying a rotation to every page of the original.
Usage :
python rotatePdf.py [-h] [-angle ANGLE] [-direction DIRECTION] [-pages PAGES] input output
positional arguments:
input Input pdf file
output Output pdf file
optional arguments:
-h, --help show this help message and exit
-angle ANGLE Rotation angle in degrees. Default is 90.
-direction DIRECTION One of clockwise or counterclockwise. Default is counterclockwise.
-pages Python list (with enclosing [] and , separated) of page numbers, starting from 1. Default is all. Example: [1, 7, 8, 13]