/// <summary> /// Adds a PdfScriptObject to the page that draws a line. /// </summary> public static PdfObjectRef DrawLine(this PdfPageWriter page, double x1, double y1, double x2, double y2, PdfGraphicsOptions options) { var obj = new PdfScriptObject(); obj.BeginGraphicsState(); options.Apply(obj); obj.BeginPath(x1, y1); obj.DrawLineTo(x2, y2); obj.EndPath(false, true, true); obj.EndGraphicsState(); return(page.WriteObject(obj)); }