cete.dynamicpdf.pageelements.path
Path
- Namespace: ceTe.DynamicPDF.PageElements
- Assemblies: ceTe.DynamicPDF.40.dll
Represents a path with sub paths.
public class Path : TaggablePageElement, ICoordinate, ISerializable
Public Class Path
Inherits TaggablePageElement
Implements ICoordinate, ISerializable
Inheritance: Object → PageElement → TaggablePageElement → Path
Implements: ICoordinate, ISerializable
Licensing
This class is a DynamicPDF Generator Professional Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Professional Edition
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Professional Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Professional Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Professional Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
Examples
The following example will display a path that incorporates several different sub paths before retuning to its starting location.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a Page and add it to the document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
' Create a path
Dim MyPath As Path = New Path(50, 150, RgbColor.Blue, RgbColor.Yellow, _ 3, LineStyle.Solid, True)
' Add some sub paths to the path
MyPath.SubPaths.Add(New CurveSubPath(50, 400, 300, 150, -200, 400))
MyPath.SubPaths.Add(New LineSubPath(300, 400))
MyPath.SubPaths.Add(New CurveToSubPath(300, 150, 50, 300))
MyPath.SubPaths.Add(New CurveFromSubPath(150, 100, 200, -100))
' Add the path to the page
MyPage.Elements.Add(MyPath)
' Save the PDF
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
class MyClass
{
static void Main()
{
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add( page );
// Create a path
Path path = new Path( 50, 150, RgbColor.Blue, RgbColor.Yellow, 3, LineStyle.Solid, true );
// Add some sub paths to the path
path.SubPaths.Add( new CurveSubPath( 50, 400, 300, 150, -200, 400 ) );
path.SubPaths.Add( new LineSubPath( 300, 400 ) );
path.SubPaths.Add( new CurveToSubPath( 300, 150, 50, 300 ) );
path.SubPaths.Add( new CurveFromSubPath( 150, 100, 200, -100 ) );
// Add the path to the page
page.Elements.Add( path );
// Save the PDF
document.Draw( @"C:\MyDocument.pdf" );
}
}
Remarks
This class can be used to specify a collection of sub paths which will be used to complete your path.
Sub paths that can be added are CurveFromSubPath, CurveSubPath, CurveToSubPath and LineSubPath.
Constructors
Path(Single, Single)
Initializes a new instance of the Path class.
public Path(float x, float y)
Public Sub New (x As Single, y As Single)
Parameters
- x: Single
X coordinate of the path.
- y: Single
Y coordinate of the path.
Path(Single, Single, Color)
Initializes a new instance of the Path class.
public Path(float x, float y, Color lineColor)
Public Sub New (x As Single, y As Single, lineColor As Color)
Parameters
- x: Single
X coordinate of the path.
- y: Single
Y coordinate of the path.
- lineColor: Color
Color of the lines of the path.
Path(Single, Single, Color, Color)
Initializes a new instance of the Path class.
public Path(float x, float y, Color lineColor, Color fillColor)
Public Sub New (x As Single, y As Single, lineColor As Color, fillColor As Color)
Parameters
- x: Single
X coordinate of the path.
- y: Single
Y coordinate of the path.
- lineColor: Color
Color of the lines of the path.
- fillColor: Color
Color of the fill of the path.
Path(Single, Single, Color, Color, Single, LineStyle, Boolean)
Initializes a new instance of the Path class.
public Path(float x, float y, Color lineColor, Color fillColor, float lineWidth, LineStyle lineStyle, bool closePath)
Public Sub New (x As Single, y As Single, lineColor As Color, fillColor As Color, lineWidth As Single, lineStyle As LineStyle, closePath As Boolean)
Parameters
- x: Single
X coordinate of the path.
- y: Single
Y coordinate of the path.
- lineColor: Color
Color of the lines of the path.
- fillColor: Color
Color of the fill of the path.
- lineWidth: Single
Width of the lines of the path.
- lineStyle: LineStyle
Style of the lines of the path.
- closePath: Boolean
Specifies if the path should be closed.
Path(Single, Single, Color, Single, LineStyle)
Initializes a new instance of the Path class.
public Path(float x, float y, Color lineColor, float lineWidth, LineStyle lineStyle)
Public Sub New (x As Single, y As Single, lineColor As Color, lineWidth As Single, lineStyle As LineStyle)
Parameters
- x: Single
X coordinate of the path.
- y: Single
Y coordinate of the path.
- lineColor: Color
Color of the lines of the path.
- lineWidth: Single
Width of the lines of the path.
- lineStyle: LineStyle
Style of the lines of the path.
Path(Single, Single, Color, Single, LineStyle, Boolean)
Initializes a new instance of the Path class.
public Path(float x, float y, Color lineColor, float lineWidth, LineStyle lineStyle, bool closePath)
Public Sub New (x As Single, y As Single, lineColor As Color, lineWidth As Single, lineStyle As LineStyle, closePath As Boolean)
Parameters
- x: Single
X coordinate of the path.
- y: Single
Y coordinate of the path.
- lineColor: Color
Color of the lines of the path.
- lineWidth: Single
Width of the lines of the path.
- lineStyle: LineStyle
Style of the lines of the path.
- closePath: Boolean
Specifies if the path should be closed.
Properties
ClosePath
Gets or sets a value specifying if the path should be closed.
public bool ClosePath { get; set; }
Public Property ClosePath As Boolean
Property Value
FillColor
Gets or sets the Color object to use for the fill of the path.
public Color FillColor { get; set; }
Public Property FillColor As Color
Property Value
ID
Gets or sets the ID of the page element. (Inherited from PageElement)
public string ID { get; set; }
Public Property ID As String
Property Value
LineCap
Gets or sets the LineCap enumeration used to specify the line cap style of the path's lines.
public LineCap LineCap { get; set; }
Public Property LineCap As LineCap
Property Value
LineColor
Gets or sets the Color object to use for the path's lines.
public Color LineColor { get; set; }
Public Property LineColor As Color
Property Value
LineJoin
Gets or sets the LineJoin enumeration used to specify the line join style of the path's lines.
public LineJoin LineJoin { get; set; }
Public Property LineJoin As LineJoin
Property Value
LineStyle
Gets or sets the LineStyle object used to specify the style of the path's lines.
public LineStyle LineStyle { get; set; }
Public Property LineStyle As LineStyle
Property Value
LineWidth
Gets or sets the width of the path's lines.
public float LineWidth { get; set; }
Public Property LineWidth As Single
Property Value
MiterLimit
Gets or sets the miter limit of the path's lines.
public float MiterLimit { get; set; }
Public Property MiterLimit As Single
Property Value
SubPaths
Gets SubPathList that contains a collection of SubPath objects.
public SubPathList SubPaths { get; }
Public Property SubPaths As SubPathList
Property Value
Tag
Gets or sets the tag of the taggable element. (Inherited from TaggablePageElement)
public Tag Tag { get; set; }
Public Property Tag As Tag
Property Value
Licensing
This property is a DynamicPDF Generator Enterprise Edition feature. One of the following licenses is required for non-evaluation usage:
- DynamicPDF Generator for .NET Enterprise Edition
- DynamicPDF Merger for .NET Enterprise Edition
- DynamicPDF ReportWriter for .NET Enterprise Edition
- DynamicPDF Core Suite for .NET Enterprise Edition
TagOrder
Gets or sets the tag order of the taggable element. (Inherited from TaggablePageElement)
public int TagOrder { get; set; }
Public Property TagOrder As Int32
Property Value
X
Gets or set the X coordinate of the path.
public float X { get; set; }
Public Property X As Single
Property Value
Y
Gets or sets the Y coordinate of the path.
public float Y { get; set; }
Public Property Y As Single
Property Value
Methods
Draw(PageWriter)
Draws the path to the given PageWriter object.
public void Draw(PageWriter writer)
Sub Draw(writer As PageWriter)
Parameters
- writer: PageWriter
PageWriter object to receive the sub path's output.
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .