PdfPathContent Class
Represents a geometrical PDF content composed of lines and curves.
public sealed class PdfPathContent : PdfVisualContentElement
Public NotInheritable Class PdfPathContent
Inherits PdfVisualContentElement
- Inheritance:
- System.ObjectPdfPathContent
Properties
Bounds
Gets the upright bounds of the PdfPathContent.
Property Value
The upright bounds of the PdfPathContent.
Overrides
Remarks
This member, although exposed as a property for easier debugging, performs complex calculations, so instead of accessing it frequently, cache its result instead.
ElementType
Gets the Path value.
public override PdfContentElementType ElementType { get; }
Public Overrides ReadOnly Property ElementType As PdfContentElementType
Property Value
The Path value.
Overrides
Subpaths
Gets the subpaths that this PdfPathContent is made up of.
public PdfSubpathCollection Subpaths { get; }
Public ReadOnly Property Subpaths As PdfSubpathCollection
Property Value
The subpaths that this PdfPathContent is made up of.
Methods
AddEllipse(PdfPoint, PdfSize)
Adds an ellipse (a closed PdfSubpath) to the end of the Subpaths.
note
PDF doesn't natively support elliptic arcs so the ellipse is approximated with four Bézier curves.
public PdfPathContent AddEllipse(PdfPoint center, PdfSize radius)
Public Function AddEllipse(center As PdfPoint, radius As PdfSize) As PdfPathContent
Parameters
center
- PdfPoint
The location of the center of the ellipse.
radius
- PdfSize
The horizontal radius of the ellipse.
Returns
A reference to this instance after the operation has completed.
See Also
AddEllipse(Double, Double, Double, Double)
Adds an ellipse (a closed PdfSubpath) to the end of the Subpaths.
note
PDF doesn't natively support elliptic arcs so the ellipse is approximated with four Bézier curves.
public PdfPathContent AddEllipse(double centerX, double centerY, double radiusX, double radiusY)
Public Function AddEllipse(centerX As Double, centerY As Double, radiusX As Double, radiusY As Double) As PdfPathContent
Parameters
centerX
- System.Double
The X-coordinate value of the center of the ellipse.
centerY
- System.Double
The Y-coordinate value of the center of the ellipse.
radiusX
- System.Double
The horizontal radius of the ellipse.
radiusY
- System.Double
The vertical radius of the ellipse.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.ArgumentException
centerX
, centerY
, radiusX
, or radiusY
is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
- System.ArgumentOutOfRangeException
radiusX
or radiusY
is less than zero.
See Also
AddRectangle(PdfPoint, PdfSize)
Adds a rectangle (a closed PdfSubpath) to the end of the Subpaths.
public PdfPathContent AddRectangle(PdfPoint startPoint, PdfSize size)
Public Function AddRectangle(startPoint As PdfPoint, size As PdfSize) As PdfPathContent
Parameters
startPoint
- PdfPoint
The PdfPoint where the rectangle (a closed PdfSubpath) begins.
size
- PdfSize
The size of the rectangle (a closed PdfSubpath).
Returns
A reference to this instance after the operation has completed.
See Also
AddRectangle(Double, Double, Double, Double)
Adds a rectangle (a closed PdfSubpath) to the end of the Subpaths.
public PdfPathContent AddRectangle(double startPointX, double startPointY, double width, double height)
Public Function AddRectangle(startPointX As Double, startPointY As Double, width As Double, height As Double) As PdfPathContent
Parameters
startPointX
- System.Double
The X-coordinate value of PdfPoint where the rectangle (a closed PdfSubpath) begins.
startPointY
- System.Double
The Y-coordinate value of PdfPoint where the rectangle (a closed PdfSubpath) begins.
width
- System.Double
The width of the rectangle (a closed PdfSubpath).
height
- System.Double
The height of the rectangle (a closed PdfSubpath).
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.ArgumentException
startPointX
, startPointY
, width
, or height
is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
- System.ArgumentOutOfRangeException
width
or height
is less than zero.
See Also
ArcTo(PdfSize, PdfPoint, Boolean, Boolean, Double)
Adds a elliptic arc to the end of the Segments of the last PdfSubpath in the Subpaths.
note
PDF doesn't natively support elliptic arcs so the arc is approximated with one to four Bézier curves.
public PdfPathContent ArcTo(PdfSize radius, PdfPoint endPoint, bool isSweepDirectionClockwise = false, bool isLargeArc = false, double rotationAngle = 0)
Public Function ArcTo(radius As PdfSize, endPoint As PdfPoint, isSweepDirectionClockwise As Boolean = False, isLargeArc As Boolean = False, rotationAngle As Double = 0) As PdfPathContent
Parameters
radius
- PdfSize
The radii (half the width and half the height) of an oval whose perimeter is used to draw the angle.
endPoint
- PdfPoint
The destination point for the end of the arc.
isSweepDirectionClockwise
- System.Boolean
A value that indicates whether the arc is drawn in the clockwise (positive-angle) or counter clockwise (negative-angle) direction.
isLargeArc
- System.Boolean
true to draw the arc greater than 180 degrees; otherwise, false.
rotationAngle
- System.Double
The rotation angle of the oval that specifies the curve. The curvature of the arc can be rotated with this parameter.
Returns
A reference to this instance after the operation has completed.
See Also
ArcTo(Double, Double, Double, Double, Boolean, Boolean, Double)
Adds a elliptic arc to the end of the Segments of the last PdfSubpath in the Subpaths.
note
PDF doesn't natively support elliptic arcs so the arc is approximated with one to four Bézier curves.
public PdfPathContent ArcTo(double radiusX, double radiusY, double endPointX, double endPointY, bool isSweepDirectionClockwise = false, bool isLargeArc = false, double rotationAngle = 0)
Public Function ArcTo(radiusX As Double, radiusY As Double, endPointX As Double, endPointY As Double, isSweepDirectionClockwise As Boolean = False, isLargeArc As Boolean = False, rotationAngle As Double = 0) As PdfPathContent
Parameters
radiusX
- System.Double
The horizontal radius of an oval whose perimeter is used to draw the angle.
radiusY
- System.Double
The vertical radius of an oval whose perimeter is used to draw the angle.
endPointX
- System.Double
The X-coordinate value of the destination point for the end of the arc.
endPointY
- System.Double
The Y-coordinate value of the destination point for the end of the arc.
isSweepDirectionClockwise
- System.Boolean
A value that indicates whether the arc is drawn in the clockwise (positive-angle) or counter clockwise (negative-angle) direction.
isLargeArc
- System.Boolean
true to draw the arc greater than 180 degrees; otherwise, false.
rotationAngle
- System.Double
The rotation angle of the oval that specifies the curve. The curvature of the arc can be rotated with this parameter.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.ArgumentException
radiusX
, radiusY
, endPointX
, or endPointY
is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
- System.ArgumentOutOfRangeException
radiusX
or radiusY
is less than zero.
See Also
BeginSubpath(PdfPoint)
Begin a new subpath.
public PdfPathContent BeginSubpath(PdfPoint startPoint)
Public Function BeginSubpath(startPoint As PdfPoint) As PdfPathContent
Parameters
startPoint
- PdfPoint
The PdfPoint where the PdfSubpath begins.
Returns
A reference to this instance after the operation has completed.
See Also
BeginSubpath(PdfPoint, Boolean)
Begin a new, optionally closed, subpath.
public PdfPathContent BeginSubpath(PdfPoint startPoint, bool isClosed)
Public Function BeginSubpath(startPoint As PdfPoint, isClosed As Boolean) As PdfPathContent
Parameters
startPoint
- PdfPoint
The PdfPoint where the PdfSubpath begins.
isClosed
- System.Boolean
A value that specifies whether the PdfSubpath's first and last PdfLineSegments are connected.
Returns
A reference to this instance after the operation has completed.
See Also
BeginSubpath(Double, Double)
Begin a new subpath.
public PdfPathContent BeginSubpath(double startPointX, double startPointY)
Public Function BeginSubpath(startPointX As Double, startPointY As Double) As PdfPathContent
Parameters
startPointX
- System.Double
The X-coordinate value of PdfPoint where the PdfSubpath begins.
startPointY
- System.Double
The Y-coordinate value of PdfPoint where the PdfSubpath begins.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.ArgumentException
startPointX
or startPointY
is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
See Also
BeginSubpath(Double, Double, Boolean)
Begin a new, optionally closed, subpath.
public PdfPathContent BeginSubpath(double startPointX, double startPointY, bool isClosed)
Public Function BeginSubpath(startPointX As Double, startPointY As Double, isClosed As Boolean) As PdfPathContent
Parameters
startPointX
- System.Double
The X-coordinate value of PdfPoint where the PdfSubpath begins.
startPointY
- System.Double
The Y-coordinate value of PdfPoint where the PdfSubpath begins.
isClosed
- System.Boolean
A value that specifies whether the PdfSubpath's first and last PdfLineSegments are connected.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.ArgumentException
startPointX
or startPointY
is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
See Also
BezierTo(PdfPoint, PdfPoint, PdfPoint)
Adds a cubic Bézier curve to the end of the Segments of the last PdfSubpath in the Subpaths.
public PdfPathContent BezierTo(PdfPoint controlPoint1, PdfPoint controlPoint2, PdfPoint endPoint)
Public Function BezierTo(controlPoint1 As PdfPoint, controlPoint2 As PdfPoint, endPoint As PdfPoint) As PdfPathContent
Parameters
controlPoint1
- PdfPoint
The first control point of the curved line segment.
controlPoint2
- PdfPoint
The second control point of the curved line segment.
endPoint
- PdfPoint
The end point of the curved line segment.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.InvalidOperationException
The PdfPathContent doesn't contain any PdfSubpath. Use BeginSubpath(PdfPoint) method before using the current method.
See Also
BezierTo(Double, Double, Double, Double, Double, Double)
Adds a cubic Bézier curve to the end of the Segments of the last PdfSubpath in the Subpaths.
public PdfPathContent BezierTo(double controlPoint1X, double controlPoint1Y, double controlPoint2X, double controlPoint2Y, double endPointX, double endPointY)
Public Function BezierTo(controlPoint1X As Double, controlPoint1Y As Double, controlPoint2X As Double, controlPoint2Y As Double, endPointX As Double, endPointY As Double) As PdfPathContent
Parameters
controlPoint1X
- System.Double
The X-coordinate value of the first control point of the curved line segment.
controlPoint1Y
- System.Double
The Y-coordinate value of the first control point of the curved line segment.
controlPoint2X
- System.Double
The X-coordinate value of the second control point of the curved line segment.
controlPoint2Y
- System.Double
The Y-coordinate value of the second control point of the curved line segment.
endPointX
- System.Double
The X-coordinate value of the end point of the curved line segment.
endPointY
- System.Double
The Y-coordinate value of the end point of the curved line segment.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.ArgumentException
controlPoint1X
, controlPoint1Y
, controlPoint2X
, controlPoint2Y
, endPointX
, or endPointY
is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
- System.InvalidOperationException
The PdfPathContent doesn't contain any PdfSubpath. Use BeginSubpath(PdfPoint) method before using the current method.
See Also
CloseSubpath()
Closes the last PdfSubpath in the Subpaths.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.InvalidOperationException
The PdfPathContent doesn't contain any PdfSubpath. Use BeginSubpath(PdfPoint) method before using the current method.
See Also
LineTo(PdfPoint)
Adds a straight line to the end of the Segments of the last PdfSubpath in the Subpaths.
public PdfPathContent LineTo(PdfPoint endPoint)
Public Function LineTo(endPoint As PdfPoint) As PdfPathContent
Parameters
endPoint
- PdfPoint
The end point of the straight line segment.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.InvalidOperationException
The PdfPathContent doesn't contain any PdfSubpath. Use BeginSubpath(PdfPoint) method before using the current method.
See Also
LineTo(Double, Double)
Adds a straight line to the end of the Segments of the last PdfSubpath in the Subpaths.
public PdfPathContent LineTo(double endPointX, double endPointY)
Public Function LineTo(endPointX As Double, endPointY As Double) As PdfPathContent
Parameters
endPointX
- System.Double
The X-coordinate value of the end point of the straight line segment.
endPointY
- System.Double
The Y-coordinate value of the end point of the straight line segment.
Returns
A reference to this instance after the operation has completed.
Exceptions
- System.ArgumentException
endPointX
or endPointY
is either System.Double.NaN, System.Double.NegativeInfinity or System.Double.PositiveInfinity.
- System.InvalidOperationException
The PdfPathContent doesn't contain any PdfSubpath. Use BeginSubpath(PdfPoint) method before using the current method.
See Also
Inherited Properties
Collection | Gets the PdfContentElementCollection that the PdfContentElement belongs to. (Inherited from PdfContentElement) |
Format | Gets or sets the formatting properties applied to the PdfVisualContentElement. (Inherited from PdfVisualContentElement) |
Next | Gets the next PdfContentElement in the Collection. (Inherited from PdfContentElement) |
Previous | Gets the previous PdfContentElement in the Collection. (Inherited from PdfContentElement) |
Transform | Gets or sets the transformation from the new (transformed) coordinate system to the original (untransformed) coordinate system. All coordinates used after the transformation are expressed in the transformed coordinate system. tipBefore setting the Transform, move PdfVisualContentElement into its own PdfContentGroup so that the transformation is confined to that PdfContentGroup and doesn't have any effect on PdfContentElements outside that PdfContentGroup. (Inherited from PdfVisualContentElement) |