-
|
base is a pdf: for me would be okay to get an image from this regions but it is not recognized as image. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
|
Vector graphics usually / often consist of many "atomic" draw commands like lines, curves, rectangles. They appear as a holistic graphic because of the geometrical vicinity of the atoms. |
Beta Was this translation helpful? Give feedback.
Vector graphics usually / often consist of many "atomic" draw commands like lines, curves, rectangles. They appear as a holistic graphic because of the geometrical vicinity of the atoms.
To be clear: These are no images and therefore cannot be extracted as such.
You can extract the drawings on a page via
page.get_drawings(), which gives yo all this details. But these are Python dictionaries - no images.You can also use
page.cluster_drawings()which detects and clusters drawing atoms that are sufficiently close to each other.It returns a list of rectangles which represent those clusters. Make a pixmap using a cluster rectangle as clip value - then you can save it as an image somewhere.