C# Console Application
The following steps outline creating a simple DynamicPDF Core Suite application.
- Open Visual Studio .NET (2010 - 2022) and create a new C# Console Application.
- On the Solution Explorer, right-click the References folder and select Add reference....
- Select DynamicPDF for .NET from the list on the .NET tab (use the appropriate framework version) and click Select.
- Click OK to add both references to the project.
- On the Solution Explorer, double-click
Program.csto view the code. - Add the following
usingdirectives to the top of the file.using ceTe.DynamicPDF;using ceTe.DynamicPDF.PageElements;Imports ceTe.DynamicPDFImports ceTe.DynamicPDF.PageElements - Add the following code to the
Mainmethod:Document document = new Document();Page page = new Page();page.Elements.Add( new Label( "Hello World!", 0, 0, 100, 12, Font.Helvetica, 12 ) );document.Pages.Add(page);document.Draw(pdfFilePath);Dim document As Document = New Document()Dim page As Page = New Page()page.Elements.Add(New Label( "Hello World!", 0, 0, 100, 12, Font.Helvetica, 12))document.Pages.Add(page)document.Draw(pdfFilePath) - Run the project to generate the PDF document.
- View the PDF by navigating to the file on your file system.