Document
Represents a PDF Document.
public class Document
Public Class Document
Inheritance: ObjectDocument
Derived: MergeDocument
Licensing Info
Basic usage of this class is a DynamicPDF Core Suite Essentials feature. However, some properties or methods require full licensing and are noted accordingly. One of the following is required for non-evaluation usage:
- Any active DynamicPDF Subscription (Essentials, Professional, Professional Plus or Ultimate).
- A DynamicPDF Core Suite for .NET v12.X Essentials license.
- It can also be used for free with a public link back to www.dynamicpdf.com and with the DynamicPDF Essentials message displaying on the bottom of each page.
Examples
This example shows how to use the document in the creation of a simple PDF document.Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
' Create a PDF Document
Dim MyDocument As Document = New Document
' Create a Page and add it to the document
Dim MyPage As Page = New Page
MyDocument.Pages.Add(MyPage)
' Add a label to the page
MyPage.Elements.Add(New Label("My PDF Document", 0, 0, 512, 40, Font.Helvetica, 30, TextAlign.Center))
' Save the PDF document
MyDocument.Draw("C:\MyDocument.pdf")
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Create a Page and add it to the document
Page page = new Page();
document.Pages.Add(page);
// Add a label to the page
page.Elements.Add(new Label("My PDF Document", 0, 0, 512, 40, Font.Helvetica, 30, TextAlign.Center));
// Save the PDF document
document.Draw(outputPath);
}
}
Remarks
This is the primary class used to generate the PDF document. It represents a single PDF Document and is made up of Pages and Outlines. The document can have a Security object associated with it to control document security and encryption. The document can be output to any object derived from the Stream class that supports writing and can easily be integrated with ASP.NET to stream the document to Internet Information Server's HTTP output stream.
Constructors
Document() | Initializes a new instance of the Document class. |
Properties
Author | Gets or sets a value indicating the author of the Document . |
CompressionLevel | Gets or sets a value indicating the compression level of the Document . |
Creator | Gets or sets a value indicating the creator of the Document . |
CustomProperties | Gets or sets a value indicating the custom properties of the Document . |
DefaultPdfFormat | Gets or sets the default format for the PDF document. |
DefaultPdfVersion | Gets or sets the default version for the PDF document. |
DiskBuffering | Gets or sets the disk buffering options for the PDF document. |
EmbeddedFiles | Gets an EmbeddedFileList containing the EmbeddedFile for the document. |
Form | Gets or sets a form object for the PDF document. |
InitialPage | Gets or sets a value indicating the initial page of the Document . |
InitialPageLayout | Gets or sets a value indicating the initial layout of the Document . |
InitialPageMode | Gets or sets a value indicating the initial page mode of the Document . |
InitialPageZoom | Gets or sets a value indicating the initial zoom of the Document . |
InitialPageZoomPercentage | Gets or sets initial page zoom percentage. |
JavaScripts | Gets a DocumentJavaScriptList containing the JavaScript entries for that document. |
Keywords | Gets or sets a value indicating the keywords of the Document . |
Language | Gets or sets a value indicating the language of the Document . |
Optimization | Gets or sets the document optimization. |
Outlines | Gets an OutlineList object that represents the top level outlines of the Document . |
OutputIntents | Gets the output intent list for the Document . |
Package | Gets or sets the document package. |
Pages | Gets a PageList object that represents the pages of the Document . |
PdfFormat | Gets or sets the PDF format for the PDF document. |
PdfVersion | Gets or sets the PDF version of the PDF document. |
PdfXVersion | Gets or sets the PDF/X version for the Document . |
Producer | Gets or sets a value indicating the producer of the Document . |
ProductBuild | Gets the product build. |
ProductVersion | Gets the product version. |
ReaderEvents | Gets the reader events of the document. |
Sections | Gets a SectionList object for the Document . |
Security | Gets or sets an object to control the security and encryption of the Document . |
StampTemplate | Gets or sets a Template object for the Document . All page elements within this Template will appear in the foreground of the other contents of the PDF. |
Subject | Gets or sets a value indicating the subject of the Document . |
Tag | Gets or sets a value indicating whether document is tagged. |
Template | Gets or sets a Template object for the Document . All page elements within this Template will appear in the background of the other contents of the PDF. |
Title | Gets or sets a value indicating the title of the Document . |
Trapped | Gets or sets a value indicating if trapping information is present in the Document . |
ViewerPreferences | Gets a ViewerPreferences object that represents the viewer preferences of the Document . |
XmpMetadata | Gets or sets the XMP metadata for the PDF document. |
Methods
AddLicense(String) | Adds a license key. |
Certify(String, Certificate, Boolean, CertifyingPermission) | Certifies with signing and Time stamping the document digitally. |
Certify(String, Certificate, CertifyingPermission) | Certifies with signing the document digitally. |
Certify(String, Certificate, TimestampServer, CertifyingPermission) | Certifies with signing and Time stamping the document digitally. |
Certify(String, SigningProvider, CertifyingPermission) | Certifies with signing and Time stamping the document digitally. |
Draw() | Outputs the generated Document to a byte array. |
Draw(Stream) | Outputs the generated Document to the given Stream object. |
Draw(String) | Outputs the generated Document to a file. |
Equals(Object) | Determines whether the specified Object is equal to the current Object . (Inherited from Object) |
FromHtml(Stream, PageDimensions, HtmlAreaPadding) | Gets a Document containing HtmlArea created with the given content. |
FromHtml(Stream, PageDimensions, HtmlAreaPadding, Uri) | Gets a Document containing HtmlArea created with the given content. |
FromHtml(Stream, PageDimensions, Uri) | Gets a Document containing HtmlArea created with the given content. |
FromHtml(String, PageDimensions, HtmlAreaPadding) | Gets a Document containing HtmlArea created with the given content. |
FromHtml(String, PageDimensions, HtmlAreaPadding, Uri) | Gets a Document containing HtmlArea created with the given content. |
FromHtml(String, PageDimensions, Uri) | Gets a Document containing HtmlArea created with the given content. |
FromHtml(Uri, PageDimensions, HtmlAreaPadding) | Gets a Document containing HtmlArea created with the given content. |
FromHtml(Uri, PageDimensions, HtmlAreaPadding, Uri) | Gets a Document containing HtmlArea created with the given content. |
FromHtml(Uri, PageDimensions, Uri) | Gets a Document containing HtmlArea created with the given content. |
GetHashCode() | Serves as a hash function for a particular type. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
Sign(String, Certificate) | Sign this document digitally. |
Sign(String, Certificate, Boolean) | Digitally sign this document with Time stamping. |
Sign(String, Certificate, TimestampServer) | Digitally sign this document with Time stamping. |
Sign(String, SigningProvider) | Digitally sign this document with SigningProvider. |
Timestamp(String, SigningProvider) | Marks the document to add a timestamp to the existing signature filed. |
Timestamp(String, TimestampServer) | Marks the document to add a timestamp to the existing signature filed. |
ToString() | Returns a String that represents the current Object . (Inherited from Object) |