Class PathRenderInfo
- java.lang.Object
-
- com.itextpdf.kernel.pdf.canvas.parser.data.AbstractRenderInfo
-
- com.itextpdf.kernel.pdf.canvas.parser.data.PathRenderInfo
-
- All Implemented Interfaces:
IEventData
public class PathRenderInfo extends AbstractRenderInfo
Contains information relating to painting current path.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.List<CanvasTag>canvasTagHierarchyHierarchy of nested canvas tags for the text from the most inner (nearest to text) tag to the most outer.private intclippingRulestatic intFILLValue specifying fill operation to perform on the current path.private booleanisClipstatic intNO_OPEnd the path object without filling or stroking it.private intoperationprivate Pathpathprivate intrulestatic intSTROKEValue specifying stroke operation to perform on the current path.-
Fields inherited from class com.itextpdf.kernel.pdf.canvas.parser.data.AbstractRenderInfo
gs
-
-
Constructor Summary
Constructors Constructor Description PathRenderInfo(java.util.Stack<CanvasTag> canvasTagHierarchy, CanvasGraphicsState gs, Path path, int operation)If the operation isNO_OPthen the rule is ignored, otherwisePdfCanvasConstants.FillingRule.NONZERO_WINDINGis used by default.PathRenderInfo(java.util.Stack<CanvasTag> canvasTagHierarchy, CanvasGraphicsState gs, Path path, int operation, int rule, boolean isClip, int clipRule)Creates the newPathRenderInfoinstance.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<CanvasTag>getCanvasTagHierarchy()Gets hierarchy of the canvas tags that wraps given text.intgetClippingRule()MatrixgetCtm()Gets the current transformation matrix.ColorgetFillColor()Gets the path's fill color.intgetLineCapStyle()Gets the line cap style.PdfArraygetLineDashPattern()Gets the path's dash pattern.intgetLineJoinStyle()Gets the line join style.floatgetLineWidth()Gets the path's line width.intgetMcid()Gets the marked-content identifier associated with thisPathRenderInfoinstancefloatgetMiterLimit()Gets the miter limit.intgetOperation()PathgetPath()Gets thePathto be renderedintgetRule()ColorgetStrokeColor()Gets the path's stroke color.booleanhasMcid(int mcid)Checks if thisPathRenderInfoinstance belongs to a marked content sequence with a given mcid.booleanhasMcid(int mcid, boolean checkTheTopmostLevelOnly)Checks if thisPathRenderInfoinstance belongs to a marked content sequence with a given mcid.booleanisPathModifiesClippingPath()Gets the clipping path flag.-
Methods inherited from class com.itextpdf.kernel.pdf.canvas.parser.data.AbstractRenderInfo
checkGraphicsState, getGraphicsState, isGraphicsStatePreserved, preserveGraphicsState, releaseGraphicsState
-
-
-
-
Field Detail
-
NO_OP
public static final int NO_OP
End the path object without filling or stroking it. This operator shall be a path-painting no-op, used primarily for the side effect of changing the current clipping path- See Also:
- Constant Field Values
-
STROKE
public static final int STROKE
Value specifying stroke operation to perform on the current path.- See Also:
- Constant Field Values
-
FILL
public static final int FILL
Value specifying fill operation to perform on the current path. When the fill operation is performed it should use either nonzero winding or even-odd rule.- See Also:
- Constant Field Values
-
path
private Path path
-
operation
private int operation
-
rule
private int rule
-
isClip
private boolean isClip
-
clippingRule
private int clippingRule
-
canvasTagHierarchy
private java.util.List<CanvasTag> canvasTagHierarchy
Hierarchy of nested canvas tags for the text from the most inner (nearest to text) tag to the most outer.
-
-
Constructor Detail
-
PathRenderInfo
public PathRenderInfo(java.util.Stack<CanvasTag> canvasTagHierarchy, CanvasGraphicsState gs, Path path, int operation, int rule, boolean isClip, int clipRule)
Creates the newPathRenderInfoinstance.- Parameters:
canvasTagHierarchy- the canvas tag hierarchygs- the graphics statepath- the path to be renderedoperation- one of the possible combinations ofSTROKEandFILLvalues orNO_OPrule- eitherPdfCanvasConstants.FillingRule.NONZERO_WINDINGorPdfCanvasConstants.FillingRule.EVEN_ODDisClip-trueindicates that current path modifies the clipping pathclipRule- eitherPdfCanvasConstants.FillingRule.NONZERO_WINDINGorPdfCanvasConstants.FillingRule.EVEN_ODD
-
PathRenderInfo
public PathRenderInfo(java.util.Stack<CanvasTag> canvasTagHierarchy, CanvasGraphicsState gs, Path path, int operation)
If the operation isNO_OPthen the rule is ignored, otherwisePdfCanvasConstants.FillingRule.NONZERO_WINDINGis used by default. With this constructor path is considered as not modifying clipping path.See
PathRenderInfo(Stack, CanvasGraphicsState, Path, int, int, boolean, int)
-
-
Method Detail
-
getOperation
public int getOperation()
- Returns:
- the operation value
-
getRule
public int getRule()
Gets eitherPdfCanvasConstants.FillingRule.NONZERO_WINDINGorPdfCanvasConstants.FillingRule.EVEN_ODD.- Returns:
- the rule value
-
isPathModifiesClippingPath
public boolean isPathModifiesClippingPath()
Gets the clipping path flag.- Returns:
trueindicates that current path modifies the clipping path
-
getClippingRule
public int getClippingRule()
Gets eitherPdfCanvasConstants.FillingRule.NONZERO_WINDINGorPdfCanvasConstants.FillingRule.EVEN_ODD.- Returns:
- the clipping rule value
-
getCtm
public Matrix getCtm()
Gets the current transformation matrix.- Returns:
- the current transformation
matrix
-
getLineWidth
public float getLineWidth()
Gets the path's line width.- Returns:
- the path's line width
-
getLineCapStyle
public int getLineCapStyle()
Gets the line cap style. SeePdfCanvasConstants.LineCapStyle.- Returns:
- the line cap style value
-
getLineJoinStyle
public int getLineJoinStyle()
Gets the line join style. SeePdfCanvasConstants.LineJoinStyle.- Returns:
- the line join style value
-
getMiterLimit
public float getMiterLimit()
Gets the miter limit.- Returns:
- the miter limit
-
getLineDashPattern
public PdfArray getLineDashPattern()
Gets the path's dash pattern.- Returns:
- the path's dash pattern as a
PdfArray
-
getStrokeColor
public Color getStrokeColor()
Gets the path's stroke color.- Returns:
- the path's stroke
color
-
getCanvasTagHierarchy
public java.util.List<CanvasTag> getCanvasTagHierarchy()
Gets hierarchy of the canvas tags that wraps given text.- Returns:
- list of the wrapping canvas tags. The first tag is the innermost (nearest to the text)
-
getMcid
public int getMcid()
Gets the marked-content identifier associated with thisPathRenderInfoinstance- Returns:
- associated marked-content identifier or -1 in case content is unmarked
-
hasMcid
public boolean hasMcid(int mcid)
Checks if thisPathRenderInfoinstance belongs to a marked content sequence with a given mcid.- Parameters:
mcid- a marked content id- Returns:
trueif thisPathRenderInfoinstance is marked with this id,falseotherwise
-
hasMcid
public boolean hasMcid(int mcid, boolean checkTheTopmostLevelOnly)Checks if thisPathRenderInfoinstance belongs to a marked content sequence with a given mcid.- Parameters:
mcid- a marked content idcheckTheTopmostLevelOnly- indicates whether to check the topmost level of marked content stack only- Returns:
trueif thisPathRenderInfoinstance is marked with this id,falseotherwise
-
-