- Open Visual Studio 2005 .NET and create a new C# ASP.NET Web Site.
- On the Solution Explorer, right click on the Web Application Project and select "Add reference...".
- Select "DynamicPDF for .NET" from the list on the ".NET" tab and click "Select" then "OK".
- On the Solution Explorer, right click on the Web Application Project and select "Add --> Add New Item...".
- Select "Web Form..." from the Templates list.
- Name the form "HelloWorld.aspx" and select the "Open" button.
- On the Solution Explorer, right click on "HelloWorld.aspx" and select "View Designer".
- Select the "Source" tab to view the HTML of the web form.
- Remove all HTML code on the web form below the @Page directive (leave the @Page directive on the web form).
- On the Solution Explorer, right click on "HelloWorld.aspx" and select "View Code".
-
Remove all using directives and replace that section with the following
code:
using System; using ceTe.DynamicPDF; using ceTe.DynamicPDF.PageElements;
-
Add the following code to the "Page_Load" method:
Document document = new Document(); ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page(); page.Elements.Add( new Label( "Hello World!", 0, 0, 100, 12, Font.Helvetica, 12 ) ); document.Pages.Add( page ); document.DrawToWeb( this );
- Right click on the new web form and select "Set As Start Page".
- Run the project to view the generated PDF document in your browser.
Note: Steps for Visual Studio 2002/2003 C# Web Form example can be found here.
| See Also |
My First DynamicPDF Document | Getting Started

