My First DynamicPDF Document | Getting Started

  1. Open Visual Studio .NET and create a new C# Console Application.
  2. On the Solution Explorer, right click on the References folder and select "Add reference...".
  3. Select "DynamicPDF for .NET" from the list on the ".NET" tab and click the "Select" button.
  4. Select "System.Web.dll" from the list on the ".NET" tab and click the "Select" button (this is needed because the Document.Draw method references it).
  5. Click the "OK" button to add both references to the project.
  6. On the Solution Explorer, double click on the "Class1.cs" class to view the code.
  7. Add the following using directives to the top of the file:
    using ceTe.DynamicPDF;
    using ceTe.DynamicPDF.PageElements;
    
  8. Add the following code to the "Main" method:
    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( "C:\\Temp\\HelloWorld.pdf" );
    
  9. Run the project to generate the PDF document. You can view it by navigating to it on your file system.

See Also 

My First DynamicPDF Document | Getting Started