Build your First App with Nasosoft PDF for .NET
Below tutorial walks-through how to create, build and run your first spreadsheet application using C#.
Please follow the step by step tutorial to create the HelloWorld application:
1. Create a new instance of PdfDocument class
2. Create a new PDF document
3. Insert the “Hello World!” string into the PDF document
4. Save the PDF document
Code Example:
PdfDocument pdfDoc = new PdfDocument();
PdfPage page = pdfDoc.Pages.Add();
PdfFont f = new PdfFont(PdfFontFamily.StandFonts.Helvetica, 20f);
for(int i = 0; i < 100; i++)
page.Graphics.DrawString("Hello world!", f, PdfBrushes.Black, new PointF(20, 20 * i));
pdfDoc.Save(fileName);
Dim pdfDoc As New PdfDocument()
Dim page As PdfPage= pdfDoc.Pages.Add()
Dim f As PdfFont = new PdfFont(PdfFontFamily.StandFonts.Helvetica, 20f)
For i As Integer = 0 To 99
page.Graphics.DrawString("Hello world!", f, PdfBrushes.Black, New PointF(20, 20 * i))
Next
pdfDoc.Save(fileName)