Welcome, guest | Sign In | My Account | Store | Cart
import fitz                            # <- PyMuPDF v 1.9.3
doc = fitz.open("mypdf.pdf")           # open the PDF
page = doc[n]                          # read page n (zero-based)
page.setRotate(-90)                    # rotate page by 90 degrees counter-clockwise
doc.save(doc.name, incremental = True)  # update the file - a sub-second matter
doc.close()

Diff to Previous Revision

--- revision 1 2016-11-05 19:34:41
+++ revision 2 2016-11-06 11:33:59
@@ -2,5 +2,5 @@
 doc = fitz.open("mypdf.pdf")           # open the PDF
 page = doc[n]                          # read page n (zero-based)
 page.setRotate(-90)                    # rotate page by 90 degrees counter-clockwise
-doc.save(oc.name, incremental = True)  # update the file - a sub-second matter
+doc.save(doc.name, incremental = True)  # update the file - a sub-second matter
 doc.close()

History