Class PdfLineCap
Specifies the line cap style to be used at the ends of the lines.
Inheritance
System.Object
PdfLineCap
Namespace: Syncfusion.Pdf.Graphics
Assembly: Syncfusion.Pdf.UWP.dll
Syntax
public sealed class PdfLineCap : Enum
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;
//Set line cap.
pen.LineCap = PdfLineCap.Round;
// 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.
'Set line cap.
pen.LineCap = PdfLineCap.Round
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
Flat
The stroke is squared off at the endpoint of the path. There is no projection beyond the end of the path.
Declaration
public const PdfLineCap Flat
Field Value
Type |
---|
PdfLineCap |
Round
A semicircular arc with a diameter equal to the line width is drawn around the endpoint and filled in.
Declaration
public const PdfLineCap Round
Field Value
Type |
---|
PdfLineCap |
Square
The stroke continues beyond the endpoint of the path for a distance equal to half the line width and is squared off.
Declaration
public const PdfLineCap Square
Field Value
Type |
---|
PdfLineCap |