PdfContentEditor.CreateLine

PdfContentEditor.CreateLine method

Creates line annotation.

public void CreateLine(Rectangle rect, string contents, float x1, float y1, float x2, float y2, 
    int page, int border, Color clr, string borderStyle, int[] dashArray, string[] LEArray)
ParameterTypeDescription
rectRectangleThe annotation rectangle defining the location of the annotation on the page.
contentsStringThe contents of the annotation.
x1SingleThe starting horizontal coordinate of the line.
y1SingleThe starting vertical coordinate of the line.
x2SingleThe ending horizontal coordinate of the line.
y2SingleThe ending vertical coordinate of the line.
pageInt32The number of original page where the annotation will be created.
borderInt32The border width in points. If this value is 0 no border is drawn. Default value is 1.
clrColorThe color of line.
borderStyleStringThe border style specifying the width and dash pattern to be used in drawing the line. This value can be: “S” (Solid), “D” (Dashed), “B” (Beveled), “I” (Inset), “U” (Underline).
dashArrayInt32[]A dash array defining a pattern of dashes and gaps to be used in drawing a dashed border. If it is used, borderSyle must be accordingly set to “D”.
LEArrayString[]An array of two values respectively specifying the beginning and ending style of the drawing line. The values can be: “Square”, “Circle”, “Diamond”, “OpenArrow”, “ClosedArrow”, “None”, “Butt”, “ROpenArrow”, “RClosedArrow”, “Slash”.

Examples

PdfContentEditor editor = new PdfContentEditor();
editor.BindPdf("example.pdf");
editor.CreateLine(new System.Drawing.Rectangle(0, 0, 100, 100), "Welcome to Aspose", 0, 0, 100, 100,
    1, 1, System.Drawing.Color.Red, "D", new int[] {2, 3}, new string[] {"OpenArrow", "ClosedArrow"});
editor.Save("example_out.pdf");

See Also