• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support

Draw Lines

Draws lines and curves on a PDF page.

Code

using DRIT.Pdf;

using var doc = new PdfDocument();
var page = doc.Pages.Add(PdfPageSize.A4);
var content = page.Content;

// Draw a line
content.MoveTo(new PdfPoint(100, 700));
content.LineTo(new PdfPoint(500, 700));
content.Stroke();

// Draw a rectangle
content.DrawRectangle(new PdfRect(100, 600, 200, 100), PdfFillRule.NonzeroWindingNumber);

// Draw a circle
content.DrawEllipse(new PdfRect(400, 600, 100, 100));

doc.Save("lines.pdf");

Output

lines.pdf

  • Improve this Doc
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX