Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 17360

How to rotate+scale PDF pages around the center with pypdf?

$
0
0

I would like to rotate PDF pages around the center (other than just multiples of 90°) in a PDF document and optionally scale them to fit into the original page.

Here on StackOverflow, I found a few similar questions, however, mostly about the outdated PyPDF2.And in the latest pypdf documentation, I could not find (or overlooked) a recipe to rotate pages around the center, e.g. for slightly tilted scanned documents, which require rotation of a few degrees.

I know that there is the Transformation Class, but the standard rotation is around the lower left corner and documentation is not explaining in detail what the matrix elements actually are.

How to rotate a PDF page around the center and optionally scale it that it fits into the original page?


Viewing all articles
Browse latest Browse all 17360

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>