Skip to content

Question: how to resize pdfs that have been rotated?  #564

@catherineweiss

Description

@catherineweiss

I have a multi-page pdf and the pages have different rotation values (180 and 270). I want to resize the pages, but the rotation is giving me difficulty.

  1. I'm currently using PyPDF2's method, .getPage(n).get('/Rotate'). Is there a method in PyMuPDF that returns the correct rotation? page.rotation returns 0 degrees for all.

  2. Do you know from prior experience how to resize the pdf page while dealing with rotation? I've been trying to create a new page using Document.newPage() with a newWidth and newHeight. And then I've been experimenting with Page.setMediaBox() and also just creating a Rect with coordinates before calling Page.showPDFpage(). All of the results crop the image before placing it on the page. (I'm trying to place the entire image on the new/smaller page.) Thanks for your help!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions