Wie rotiere ich eine Seite nach willkürlichem Winkel in pymupdf?Python

Python-Programme
Anonymous
 Wie rotiere ich eine Seite nach willkürlichem Winkel in pymupdf?

Post by Anonymous »

Ich konnte nicht finden, wie man eine Textseite eines PDF um einen Arbitraty -Winkel in der Pymupdf -Dokumentation dreht.
Es gibt Seite. Orientierungsänderung.import pymupdf

doc = pymupdf.open("Rest.pdf") # open document
page = doc[0] # get the 1st page of the document
page.set_rotation(0) # rotate the page

matrix = pymupdf.Matrix(1,0,0,1,0,0)
matrix.prerotate(2.5) # 2.5 degrees

page.add_transformation(matrix) # BUT THIS DOES NOT EXIST!

doc.save("Test_rotated.pdf")
< /code>
Kann dies überhaupt gemacht werden? Oder muss ich den Text vielleicht in ein Bild umwandeln und dieses Bild dann drehen? Vielen Dank für alle Hinweise.

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post