### About PdfDocument

PdfDocument is an extension of the PDFKit, a JavaScript PDF generation library.

The key differences are:

- A page is divided into three sections: header, body and footer. Each of these sections represents a drawing area with its own methods for drawing text and graphics.
- Text of the header and footer areas can be defined declaratively and support macros for automatic page numbering.
- The graphics state management methods such as fillColor, lineWidth are incapsulated within the pen and brush entities, that acts in more friendly way for .NET developers.

It provides API for drawing text, vector graphics and images.

### Using PdfDocument

Here is a typical sequence of steps when using PdfDocument:

1. Create the PdfDocument class instance with the ended event handler declared. The Blob object containing document data will be passed to this event handler when document rendering is done, where it can be saved to a file.
2. Draw the document using the instance members.
3. Finally, call end method of the instance to finish rendering and raise the ended event.

Following is the minimal code required to generate a single page blank document:

    var doc = new wijmo.pdf.PdfDocument({
        ended: function (sender, args) {
            wijmo.pdf.saveBlob(args.blob, "PdfDocument.pdf");
        }
    });

    doc.end();