This quick start guides you through the steps of creating a simple PDF application. You begin by creating a Windows Forms App in Visual Studio, creating an instance of C1PdfDocument class, adding content to it, and saving it as a PDF file.
The following image showcases the Pdf file generated using the PDF library.
C# |
Copy Code
|
---|---|
// Create the C1PdfDocument object. C1PdfDocument pdf = new C1PdfDocument(); |
Define a text format for drawing a string in the specified rectangle with the specified brush and font objects using DrawString method of the C1PdfDocument class.
C# |
Copy Code
|
---|---|
// Add content to the page. RectangleF rect = pdf.PageRectangle; rect.Inflate(-72, -72); Font font = new Font("Arial", 12); pdf.DrawString("Hello World!", font, Brushes.Black, rect); |
Now, you can save the document using Save method of the C1PdfDocument class.
C# |
Copy Code
|
---|---|
// Save the document to a file. pdf.Save("Hello_World.pdf"); |