Package com.datalogics.PDFL
Class Path
java.lang.Object
com.datalogics.PDFL.Element
com.datalogics.PDFL.Path
A path in a PDF file defines shapes. Paths in PDF files are used to draw lines, define filled areas, and define boundaries for clipping graphics. A path is composed of straight and curved line segments.
-
Constructor Summary
ConstructorsConstructorDescriptionPath()Create a path.Path(GraphicState graphicState) Create a path with a given graphic state. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a Bezier curve from the current path using the first two points specified as Bezier control points ending at the third point.voidAdds a Bezier curve from the current path.voidAdds a Bezier curve from the current path.voidAdds a line to the current path from the current path position.voidAdds a rectangle to the current path with the lower left corner at the give point, and with the width and height specified.clone()Makes a copy of the path.clone(EnumSet<ElementCloneFlags> cloneFlags) Makes a copy of the path.voidCloses the current subpath.colorConvert(Document document, ColorProfile prof, RenderIntent intent, boolean embed) Applies the specified ICC ColorProfile to the Pathvoiddelete()Get the graphic state of the current path.Gets the fill and stroke attributes of a path.Get the segments of the path.voidMoves the current point of the path to the given point.voidsetGraphicState(GraphicState gstate) Set the Graphic State of the current path.voidsetPaintOp(EnumSet<PathPaintOpFlags> paintops) Sets the fill and stroke attributes of a path.voidsetSegments(List<Segment> segments) Set the segments of the path.
-
Constructor Details
-
Path
public Path()Create a path. -
Path
Create a path with a given graphic state.- Parameters:
graphicState- the initial graphic state for the path
-
-
Method Details
-
delete
public void delete() -
getGraphicState
Get the graphic state of the current path.May return null if this element does not have a GraphicState.
-
setGraphicState
Set the Graphic State of the current path.- Parameters:
gstate- the new/updated Graphic State for the path.
-
getPaintOp
Gets the fill and stroke attributes of a path.- Returns:
- the PathPaintOpFlags flags describing the fill and stroke attributes.
-
setPaintOp
Sets the fill and stroke attributes of a path.- Parameters:
paintops- the flags describing the fill and stroke attributes.
-
moveTo
Moves the current point of the path to the given point.- Parameters:
Point- the coordinates of the new current point.
-
addLine
Adds a line to the current path from the current path position. The given point becomes the new current position.- Parameters:
Point- the coordinates of the endpoint of the new line.
-
addRect
Adds a rectangle to the current path with the lower left corner at the give point, and with the width and height specified.- Parameters:
Point- the coordinates of the lower left corner of the new rectangle.Width- the width of the new rectangle.Height- the height of the new rectangle.
-
addCurve
Adds a Bezier curve from the current path using the first two points specified as Bezier control points ending at the third point. The new current point is then set to the third point.- Parameters:
Point1- first Bezier control pointPoint2- second Bezier control pointPoint3- the ending Point of the Bezier curve which will also be the current point of the current path.
-
addCurveV
Adds a Bezier curve from the current path. This extends from the current path to the point Point2 using the current point and the first point specified as Bezier control points ending at the second point. The new current point is then set to the second point.- Parameters:
Point1- first Bezier control pointPoint2- the ending Point of the Bezier curve which will also be the new current point of the path.
-
addCurveY
Adds a Bezier curve from the current path. This extends from the current path to the point Point2 using the two points specified as Bezier control points ending at the second point. The new current point is then set to the second point.- Parameters:
Point1- first Bezier control pointPoint2- second Bezier control point and the ending Point of the Bezier curve which will also be the new current point of the path.
-
closePath
public void closePath()Closes the current subpath. -
clone
Makes a copy of the path.Make a copy of an path to obtain a new path that has a distinct set of attributes.
-
clone
Makes a copy of the path.Make a copy of an path to obtain a new path that has a distinct set of attributes.
-
getSegments
Get the segments of the path.Returns a list of Segment objects, one for each segment in the path.
-
setSegments
Set the segments of the path.- Parameters:
segments- The segments in the path. This list must have at least one element.
-
colorConvert
Applies the specified ICC ColorProfile to the Path- Parameters:
document- The document the element belongs to.prof- The ICC ColorProfile to be applied.intent- The ICC Rendering Intent for the ColorProfileembed- If true, embed the color space and make the object calibrated. If it is false and the target profile is CMYK, RGB, or Gray, the colors space of the resulting object, after conversion, will be DeviceCMYK, DeviceRGB, or DeviceGray, respectively.- Returns:
- A new Path with the applied ICC ColorProfile.
-