Enum PdfDashStyle
- Namespace
- Syncfusion.Pdf.Graphics
- Assembly
- Syncfusion.Pdf.Portable.dll
Possible dash styles of the pen.
public enum PdfDashStyle
Fields
Custom = 5
User defined dash style.
Dash = 1
Dashed line.
DashDot = 3
Dash-dot line.
DashDotDot = 4
Dash-dot-dot line.
Dot = 2
Dotted line.
Solid = 0
Solid line.
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)