Closed caseykim closed 7 years ago
Hi Casey Kim,
Thank you for opening the issue!
I'm super busy this week, but I'll try to look into this as soon as I can.
From a quick test, I can see that the PDF you sent me has the Rotate
keyword set to 90 (degrees).
Essentially this means that the page is editable in :landscape
and shows 90 degrees rotated.
For now, you can use pdf.pages[0].fix_rotation
to rotate the actual page data and make the rotation part of the page data (than it shows landscape).
I didn't check if the orientation
method should review the Rotate
property or if the design of the API meant the orientation
method to be used to check for the pre-rotated state, but I will look into this later.
Good luck and thanks for the issue. Bo.
@boazsegev thanks for the fast response! fix_rotation
worked great for my use.
It makes sense that the API looks for the pre-rotated state, which is the original orientation,
and the comments on fix_rotation
were really clear and helpful :)
It would be nice to have this documented on orientation
and page_size
as well just to be clear that original orientation might be different from what we expect/see in the browser.
You're welcome :-)
Thank you for pointing this out. I'll make sure to update the documentation. 👍
I had the same issue. But in my case, I had a pdf in landscape position (but when I opened it with mac preview, the rotation is portrait) and when i used #fix_rotation, the pdf stay upside down but in the 1.0.9 version, the issue was resolved. thanks
Sheet 1.pdf both
page_size
andorientation
work correctly for most of pdf's but they returned incorrect results on few pdf's I've tested.for example, the attached PDF's page size is 36 × 24 inches (landscape) with both Media Box and Crop Box 2592 x 1728 poions (taken from mac preview) but when I parse and analyze the pdf with CombinePDF, I get
the numbers are correct but in wrong positions for page size