/// <summary> /// Adds a PdfScriptObject to the page that draws a rounded rectangle given 2 coordinates. /// </summary> public static PdfObjectRef DrawRoundedRectangle2(this PdfPageWriter page, double x1, double y1, double x2, double y2, double radius, PdfGraphicsOptions options) { var obj = new PdfScriptObject(); obj.BeginGraphicsState(); options.Apply(obj); obj.DrawRoundedRectangle2(x1, y1, x2, y2, radius); obj.EndPath(true, true, true); obj.EndGraphicsState(); return(page.WriteObject(obj)); }
/// <summary> /// Adds a PdfScriptObject to the page that draws a rectangle given 2 coordinates. /// </summary> public static PdfObjectRef DrawRectangle2(this PdfPageWriter page, double x1, double y1, double x2, double y2, PdfGraphicsOptions options, double leftRotationDegrees = 0.0) { var obj = new PdfScriptObject(); obj.BeginGraphicsState(); options.Apply(obj); obj.DrawRectangle2(x1, y1, x2, y2, leftRotationDegrees); obj.EndPath(true, true, true); obj.EndGraphicsState(); return(page.WriteObject(obj)); }
/// <summary> /// Adds a PdfScriptObject to the page that draws a rounded rectangle given left-upper coordinates and width and height. /// </summary> public static PdfObjectRef DrawRoundedRectangle(this PdfPageWriter page, double x, double y, double width, double height, double radius, PdfGraphicsOptions options) { var obj = new PdfScriptObject(); obj.BeginGraphicsState(); options.Apply(obj); obj.DrawRoundedRectangle(x, y, width, height, radius); obj.EndPath(true, true, true); obj.EndGraphicsState(); return(page.WriteObject(obj)); }
/// <summary> /// Adds a PdfScriptObject to the page that draws a circle. /// </summary> public static PdfObjectRef DrawCircle(this PdfPageWriter page, double x, double y, double ray, PdfGraphicsOptions options) { var obj = new PdfScriptObject(); obj.BeginGraphicsState(); options.Apply(obj); obj.DrawCircle(x, y, ray); obj.EndPath(true, true, true); obj.EndGraphicsState(); return(page.WriteObject(obj)); }
/// <summary> /// Adds a PdfScriptObject to the page that draws a rectangle given left-upper coordinates and width and height. /// </summary> public static PdfObjectRef DrawRectangle(this PdfPageWriter page, double x, double y, double width, double height, PdfGraphicsOptions options, double leftRotationDegrees = 0.0) { var obj = new PdfScriptObject(); obj.BeginGraphicsState(); options.Apply(obj); obj.DrawRectangle(x, y, width, height, leftRotationDegrees); obj.EndPath(true, true, true); obj.EndGraphicsState(); return(page.WriteObject(obj)); }
/// <summary> /// Adds a PdfScriptObject to the page that draws a oval given 2 coordinates. /// </summary> public static PdfObjectRef DrawOval2(this PdfPageWriter page, double x1, double y1, double x2, double y2, PdfGraphicsOptions options) { var obj = page.DocumentWriter.CreatePdfScriptObject(); obj.BeginGraphicsState(); options.Apply(obj); obj.DrawOval2(x1, y1, x2, y2); obj.EndPath(true, true, true); obj.EndGraphicsState(); return(page.WriteObject(obj)); }
/// <summary> /// Adds a PdfScriptObject to the page that draws an oval given left-upper coordinates and width and height. /// </summary> public static PdfObjectRef DrawOval(this PdfPageWriter page, double x, double y, double width, double height, PdfGraphicsOptions options) { var obj = page.DocumentWriter.CreatePdfScriptObject(); obj.BeginGraphicsState(); options.Apply(obj); obj.DrawOval(x, y, width, height); obj.EndPath(true, true, true); obj.EndGraphicsState(); return(page.WriteObject(obj)); }
/// <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)); }
public void SetGraphicsOptions(PdfGraphicsOptions graphicsOptions) { graphicsOptions.Apply(this); }