Enum PdfDashStyle
Possible dash styles of the pen.
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.Base.dll
Syntax
public enum PdfDashStyle
Examples
//Create a new PDF document.
PdfDocument doc = new PdfDocument();
//Add a page to the document.
PdfPage page = doc.Pages.Add();
//Create PDF graphics for the page
PdfGraphics graphics = page.Graphics;
//Create new PDF pen instance.
PdfPen pen = new PdfPen(Color.Red);
//Set custom dash style.
pen.DashStyle = PdfDashStyle.Custom;
// Create a custom dash pattern.
pen.DashPattern = new float[] { 4.0f, 2.0f, 1.0f, 3.0f };
//Draw rectangle.
graphics.DrawRectangle(pen, new RectangleF(10, 10, 200, 100));
//Save the document.
doc.Save("Output.pdf");
//Close the document.
doc.Close(true);
'Create a new PDF document.
Dim doc As New PdfDocument()
'Add a page to the document.
Dim page As PdfPage = doc.Pages.Add()
'Create PDF graphics for the page
Dim graphics As PdfGraphics = page.Graphics
'Create new PDF pen instance.
Dim pen As New PdfPen(Color.Red)
'Set custom dash style.
pen.DashStyle = PdfDashStyle.Custom
'Create a custom dash pattern.
pen.DashPattern = New Single() { 4.0F, 2.0F, 1.0F, 3.0F}
'Draw rectangle.
graphics.DrawRectangle(pen, New RectangleF(10, 10, 200, 100))
'Save the document.
doc.Save("Output.pdf")
'Close the document.
doc.Close(True)
Fields
Name | Description |
---|---|
Custom | User defined dash style. |
Dash | Dashed line. |
DashDot | Dash-dot line. |
DashDotDot | Dash-dot-dot line. |
Dot | Dotted line. |
Solid | Solid line. |