Closed Tejareddy94 closed 4 months ago
The main difference between the different PDF files is that the rotated page uses the 0 -1 1 0 0 597.12 cm
definition before inserting the main image, which basically defines the transformation matrix. The image (most likely) is the same in both cases for this reason, thus the output is correct in my opinion.
Slightly related to #2592.
Kindly let me know if there is any workaround or solution to extract rotated image?
Or it is not possible to get that rotated image
or what better i can do to get the rotated image
The embedded images have their original rotation, thus pypdf extracts it like this. For your specific example, you might want to retrieve the page rotation and apply this to your extracted image accordingly.
okay Thank you @stefan6419846
We have a usecase where pages in pdf are roated we are rotating with flatten rotation using qpdf tool. After that we are trying to extract images from the pdf but it is extracting unrotated images even after using
page.transfer_rotation_to_content()
Environment
Which environment were you using when you encountered the problem?
Code + PDF
This is a minimal, complete example that shows the issue: reader = PdfReader(self.pdf_path)
Share here the PDF file(s) that cause the issue. The smaller they are, the better. Let us know if we may add them to our tests!
sv600_c_normal.pdf The above one is original pdf The below one is the rotated pdf with qpdf tool
Rotated pdf 2na5UUZDvC7M6ft1YDpsyPvz (copy).pdf
Traceback
So when i try to extract image from rotated pdf it extracted image without rotation instead it would have extracted with rotated image
Can you point out where is the mistake is or i am doing something wrong Thank you