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: |
Replies: 2 comments 6 replies
|
Please provide the problem file / page. |
|
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. |
Problem solved.
Before processing the page, I set the rotation to 0 and everything works fine.