Is there a way to get the values of tags from the Graphics State Parameter Dictionary using PyMuPDF, especially in the case of drawings? #2356
-
When we extract Graphics using page.get_drawings() or page.get_cdrawings() methods of PyMuPDF, we get certain information about wfh graphics object. For every drawing, there would be a Graphics State Parameter Dictionary (GS) in the internal structure. A Sample Graphics State Dictionary attached below: The above screenshot is the information corresponding to a graphics state. I want to know if there is a way to extract these properties for a path object from the internal structure of a PDF using PyMuPDF. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
No, sorry this is not possible like this. The reason being that With the new version 1.22.0 there are more data available:
|
Beta Was this translation helpful? Give feedback.
No, sorry this is not possible like this. The reason being that
get_drawings()
(like alsoget_text()
) is not PDF-specific, but works for all MuPDF-supported document types like EPUB or XPS.And they do not have the kind of things you are mentioning.
With the new version 1.22.0 there are more data available:
None
.page.get_drawings(extended=True)
, clipping paths are returned, as well as so-called group paths. The remaining "standard" paths (stroke, fill, fill-stroke) then have a new "level" key (integer) which indicates the ownership to some preceding clip or group. Group paths contain information like blend mode. Fairly c…