How do I extract the alpha constant from the graphics state?


In the PDF spec, there is an alpha constant that is a graphics state
parameter. I cannot find a method to get this from the GState in
PDFTron. There is the AISMask, but I cannot find any way to extract
the alpha constant. I read some older messages and it was stated that
PDFTron does support this feature of PDF 1.4. How can I extract this
You can use element.GetGState().GetOpacityFill() to obtain the alpha
value constant used to any path or text element. Similarly use
GetOpacityStroke() to obtain the alpha value constant used to stroke
path or text elements.

Use element.IsFilled()/Stroked() to determine whether a path is filled
or stoked.
Similarly use element.GetGState().GetTextRenderMode() to determine
whether the current text element should be filled or stroked (or

For more information, please see: