-
Notifications
You must be signed in to change notification settings - Fork 617
How to Rotate PDF pages in a handful of lines (v1.9.3)
Jorj X. McKie edited this page Nov 10, 2016
·
2 revisions
This works with version 1.9.3:
import fitz
doc = fitz.open("file.pdf")
for i in range(len(doc)): # len(doc) = doc.pageCount
doc[i].setRotate(90) # doc[i] = doc.loadPage(i)
doc.save(doc.name, incremental = True)
The above takes less than 2 seconds (!) for the 1310 pages of the Adobe manual ...
HOWTO Button annots with JavaScript
HOWTO work with PDF embedded files
HOWTO extract text from inside rectangles
HOWTO extract text in natural reading order
HOWTO create or extract graphics
HOWTO create your own PDF Drawing
Rectangle inclusion & intersection
Metadata & bookmark maintenance