Extracting an image from a rect #4835
-
|
Hi everyone. If I have the coordinates that allow me to correctly draw the area I'm interested in on the PDF, why can't I get the image with get_pixmap using the same coordinates? For example (rect given as input to the function): The images it manages to save are of completely messed up areas, then at a certain point I get: |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
|
Please provide the problem file / page. |
Beta Was this translation helpful? Give feedback.
-
|
Your code could be simpler, but otherwise looks correct. You could could simply do: pix = page.get_pixmap(clip=rect, dpi=150)
pix.save("output.png")If you data protection concerns you can send the file to my email address instead of attaching it here. In Artifex, we are all bound by Non Disclosure Agreements, so rest assured that your data is safe. |
Beta Was this translation helpful? Give feedback.
Problem solved.
Before processing the page, I set the rotation to 0 and everything works fine.