ASPPDF is an active server part written by Persists package INC. With this part you'll dynamically produce, browse and modify portable Document Format (PDF) files. PDF is the de-facto world-wide commonplace for making and exchanging platform-independent printable documents. Giving your ASP.NET MVC / ASP.Net-based web applications the power to come up with and modify PDF documents on the fly opens endless opportunities for you and your users. Our initial application can produce a one-page PDF document, set its Title and Creator properties, and draw the phrase "Hello, World!" in giant helvetica letters across the page.

VBScript
Set Pdf = Server.CreateObject("Persits.Pdf")
Set Doc = Pdf.CreateDocument
Doc.Title = "ASPPDF Chapter 3 Hello World Sample"
Doc.Creator = "Peter"
Set Page = Doc.Pages.Add
Set Font = Doc.Fonts("Helvetica")
Params = "x=0; y=650; width=612; alignment=center; size=50"
Page.Canvas.DrawText "Hello World!", Params, Font
Filename = Doc.Save( Server.MapPath("hello.pdf"), False )
Response.Write "Success! Download your PDF file <A HREF=" & Filename & ">here</A>"

C#
IPdfManager objPdf = new PdfManager();
IPdfDocument objDoc = objPdf.CreateDocument(Missing.Value);
objDoc.Title = "ASPPDF Chapter 3 Hello World Sample";
objDoc.Creator = "Peter";
IPdfPage objPage = objDoc.Pages.Add(Missing.Value, Missing.Value, Missing.Value);
IPdfFont objFont = objDoc.Fonts["Helvetica", Missing.Value];
String strParams = "x=0; y=650; width=612; alignment=center; size=50";
objPage.Canvas.DrawText( "Hello World!", strParams, objFont );
String strFilename = objDoc.Save( Server.MapPath("hello.pdf"), false );
lblResult.Text = "Success! Download your PDF file <A HREF=" + strFilename + ">here</A>";


The primary line creates an instance of the PdfManager object, ASPPDF's top-level object. the subsequent line creates an empty PdfDocument object. The Pdf.CreateDocument technique accepts one optional argument, a document ID string. If no ID is specified , ASPPDF can generate a random one automatically. The document ID argument isn't used.
Doc.Title = "ASPPDF Chapter 3 hello World Sample"
Doc.Creator = "Peter"

That 2 lines above, will set the document's Title and Creator. These values may be viewed in acrobat Reader below File/Document Properties/Summary. different document properties which will be set via the PdfDocument object include Subject, Author, Keywords, Producer, CreationDate and ModDate.
Set Page = Doc.Pages.Add

This line adds a new page to the document. The Pages.Add technique accepts 3 optional arguments: width, Height (in PDF units, one unit equals 1/72 of an inch) and InsertBefore that controls the location of the new page among existing page (not applicable if the document is at the start empty).

By default, the page width and height are 612 and 792, severally, that corresponds to the quality 8.5" x 11" size.

If InsertBefore is omitted, the new page is added to the end of the document. If present, it should be a 1-based index of an existing page within the document.
Set Font = Doc.Fonts("Helvetica")

This line queries the Doc.Fonts collection for a desired font. The default parameterized Fonts..Item property expects a font name as the initial parameter, and a CharSet code because the second optional parameter.
Params = "x=0; y=650; width=612; alignment=center; size=50"
Page.Canvas.DrawText "Hello World!", Params, Font

These 2 lines show the text "Hello World!" in size fifty helvetica on the page. (The auxiliary string variable Params is used for readability functions only. The second argument to Canvas.DrawText might even be an initialized PdfParam object.)

Besides the text and font arguments, 5 numeric arguments are being passed to the DrawText technique. X and Y are always needed, the others are optional in most cases. during this case, text alignment is set to center that makes the width parameter required also.

Filename = Doc.Save( Server.MapPath("hello.pdf"), False )

This line saves the document to disk. the primary argument is required and should be set to a full file path. The second argument is optional. If set to True or omitted, it instructs the Save technique to write an existing file. If set to False, it forces distinctive file name generation. as an example, if the file hello.pdf already exists within the specified  directory and another document is being saved below the same name, the Save technique tries the filenames hello(1).pdf, hello(2).pdf, etc., till a non-existent name is found. The Save method returns the filename (without the path) below that the file was saved.