Getting a Rectangle as an image from a PDF #2207
Answered
by
JorjMcKie
Aadil-5122
asked this question in
Looking for help
-
I just want help in the above specified issue that: I want a particular part (a Specified Rectangle) of PDF as image (using Python and PyMuPDF) only! |
Beta Was this translation helpful? Give feedback.
Answered by
JorjMcKie
Feb 2, 2023
Replies: 2 comments
-
If you know the rectangle coordinates on a page, simply do this: pix = page.get_pixmap(clip=rect)
pix.save("your-image.png") Please remember that |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
JorjMcKie
-
Thanks alot sir! |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you know the rectangle coordinates on a page, simply do this:
Please remember that
get_pixmap()
has a number of parameters, that let you choose the desired colorspace, resolution (dpi) and more.