CreateLine

PdfContentEditor.CreateLine method

创建线注释。

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)
范围类型描述
rectRectangle定义页面上注释位置的注释矩形。
contentsString注释的内容。
x1Single线的起始水平坐标。
y1Single线的起始垂直坐标。
x2Single线的结束水平坐标。
y2Single线的结束垂直坐标。
pageInt32将在其中创建注释的原始页数。
borderInt32以磅为单位的边框宽度。如果此值为 0,则不绘制边框。默认值为 1。
clrColor线的颜色。
borderStyleString指定用于绘制线条的宽度和虚线图案的边框样式。 此值可以是:“S”(实线)、“D”(虚线)、“B”(斜角)、“I”(插图) , “U”(下划线)。
dashArrayInt32[]一个虚线数组,定义用于绘制虚线边框的虚线和间隙模式。 如果使用它,borderSyle 必须相应地设置为“D”。
LEArrayString[]两个值的数组,分别指定绘制线的开始和结束样式。 值可以是:“Square”、“Circle”、“Diamond”、“OpenArrow”、“ClosedArrow”、“None”、“Butt” 、“ROpenArrow”、“RClosedArrow”、“Slash”。

例子

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");

也可以看看