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# |
コードのコピー
|
---|---|
// C1PdfDocument オブジェクトを作成します 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# |
コードのコピー
|
---|---|
// ページにコンテンツを追加します 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# |
コードのコピー
|
---|---|
// ドキュメントをファイルに保存します pdf.Save("Hello_World.pdf"); |