cete.dynamicpdf.document
Document
- Namespace: ceTe.DynamicPDF
- Assemblies: DynamicPDF.CoreSuite.dll
Represents a PDF Document.
public class Document
Public Class Document
Inheritance: Object → Document
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.
public Document()
Public Sub New ()
Licensing Info
This constructor is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Properties
Author
Gets or sets a value indicating the author of the Document .
public string Author { get; set; }
Public Property Author As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This value appears as a property of the generated PDF document.
CompressionLevel
Gets or sets a value indicating the compression level of the Document .
public int CompressionLevel { get; set; }
Public Property CompressionLevel As Int32
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
A value from 0 to 9 indicating the compression level of the document. Six (6) is the default. Zero (0) represents no compression and nine (9) represents the best compression. This value will only affect the compression of the content streams of the documents pages. Depending on the type of document you are creating, it may not affect the size significantly.
Creator
Gets or sets a value indicating the creator of the Document .
public string Creator { get; set; }
Public Property Creator As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This value appears as a property of the generated PDF document.
CustomProperties
Gets or sets a value indicating the custom properties of the Document .
public CustomPropertyList CustomProperties { get; }
Public Property CustomProperties As CustomPropertyList
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to add custom properties to the document.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
' Create a page and add it to the document
Dim page As Page = New Page
document.Pages.Add(page)
page.Elements.Add(New Label("Document custom properties", 0, 0, 400, 100))
'Add custom properties to the document
Dim list As CustomPropertyList = document.CustomProperties
list.Add("name1", "value1")
list.Add("name2", "value2")
list.Add("name3", "value3")
list.Add("name4", "value4")
' Save the PDF document
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
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);
page.Elements.Add(new Label("Document custom properties", 0, 0, 400, 100));
// Add custom properties to the document
CustomPropertyList list = document.CustomProperties;
list.Add("name1", "value1");
list.Add("name2", "value2");
list.Add("name3", "value3");
list.Add("name4", "value4");
// Save the PDF document
document.Draw(outputPath);
}
}
DefaultPdfFormat
Gets or sets the default format for the PDF document.
public static PdfFormat DefaultPdfFormat { get; set; }
Public Shared Property DefaultPdfFormat As PdfFormat
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This property will determine whether the document is linearized or not.
DefaultPdfVersion
Gets or sets the default version for the PDF document.
public static PdfVersion DefaultPdfVersion { get; set; }
Public Shared Property DefaultPdfVersion As PdfVersion
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
DiskBuffering
Gets or sets the disk buffering options for the PDF document.
public DiskBufferingOptions DiskBuffering { get; set; }
Public Property DiskBuffering As DiskBufferingOptions
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
EmbeddedFiles
Gets an EmbeddedFileList containing the EmbeddedFile for the document.
public EmbeddedFileList EmbeddedFiles { get; }
Public Property EmbeddedFiles As EmbeddedFileList
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Form
Gets or sets a form object for the PDF document.
public Form Form { get; }
Public Property Form As Form
Property Value
Licensing Info
Basic usage of this property 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.
InitialPage
Gets or sets a value indicating the initial page of the Document .
public int InitialPage { get; set; }
Public Property InitialPage As Int32
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
InitialPageLayout
Gets or sets a value indicating the initial layout of the Document .
public PageLayout InitialPageLayout { get; set; }
Public Property InitialPageLayout As PageLayout
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
InitialPageMode
Gets or sets a value indicating the initial page mode of the Document .
public PageMode InitialPageMode { get; set; }
Public Property InitialPageMode As PageMode
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
InitialPageZoom
Gets or sets a value indicating the initial zoom of the Document .
public PageZoom InitialPageZoom { get; set; }
Public Property InitialPageZoom As PageZoom
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
InitialPageZoomPercentage
Gets or sets initial page zoom percentage.
public float InitialPageZoomPercentage { get; set; }
Public Property InitialPageZoomPercentage As Single
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
JavaScripts
Gets a DocumentJavaScriptList containing the JavaScript entries for that document.
public DocumentJavaScriptList JavaScripts { get; }
Public Property JavaScripts As DocumentJavaScriptList
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Keywords
Gets or sets a value indicating the keywords of the Document .
public string Keywords { get; set; }
Public Property Keywords As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This value appears as a property of the generated PDF document.
Language
Gets or sets a value indicating the language of the Document .
public string Language { get; set; }
Public Property Language As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This value appears as the language identifier property of the generated PDF document.
Optimization
Gets or sets the document optimization.
public DocumentOptimization Optimization { get; set; }
Public Property Optimization As DocumentOptimization
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Outlines
Gets an OutlineList object that represents the top level outlines of the Document .
public OutlineList Outlines { get; }
Public Property Outlines As OutlineList
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to create an outline for a PDF document.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
' Add three blank pages
document.Pages.Add(New Page(PageSize.Letter))
document.Pages.Add(New Page(PageSize.Letter))
document.Pages.Add(New Page(PageSize.Letter))
'Add a top level outline and set properties
Dim outline1 As Outline = document.Outlines.Add("Outline1")
outline1.Style = TextStyle.Bold
outline1.Color = New RgbColor(1.0F, 0.0F, 0.0F)
'Add child outlines
Dim outline1A As Outline = outline1.ChildOutlines.Add("Outline1A", New ZoomDestination(2, PageZoom.FitPage))
outline1A.Expanded = False
Dim outline1A1 As Outline = outline1A.ChildOutlines.Add("Outline1A1", New XYDestination(2, 0, 0))
Dim outline1A2 As Outline = outline1A.ChildOutlines.Add("Outline1A2", New ZoomDestination(2, PageZoom.FitHeight))
Dim outline1B As Outline = outline1.ChildOutlines.Add("Outline1B", New ZoomDestination(2, PageZoom.FitWidth))
'Add a second top level outline
Dim outline2 As Outline = document.Outlines.Add("Outline2", New XYDestination(3, 0, 300))
'Add a child outline
Dim outline2A As Outline = outline2.ChildOutlines.Add("Outline2A")
' Save the PDF document
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Add three blank pages
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));
// Add a top level outline and set properties
Outline outline1 = document.Outlines.Add("Outline1");
outline1.Style = TextStyle.Bold;
outline1.Color = new RgbColor(1.0f, 0.0f, 0.0f);
// Add child outlines
Outline outline1A = outline1.ChildOutlines.Add("Outline1A", new ZoomDestination(2, PageZoom.FitPage));
outline1A.Expanded = false;
Outline outline1A1 = outline1A.ChildOutlines.Add("Outline1A1", new XYDestination(2, 0, 0));
Outline outline1A2 = outline1A.ChildOutlines.Add("Outline1A2", new ZoomDestination(2, PageZoom.FitHeight));
Outline outline1B = outline1.ChildOutlines.Add("Outline1B", new ZoomDestination(2, PageZoom.FitWidth));
// Add a second top level outline
Outline outline2 = document.Outlines.Add("Outline2", new XYDestination(3, 0, 300));
// Add a child outline
Outline outline2A = outline2.ChildOutlines.Add("Outline2A");
// Save the PDF document
document.Draw(outputPath);
}
}
Remarks
See the Outlines and Bookmarks topic for more on Outlines.
OutputIntents
Gets the output intent list for the Document .
public OutputIntentList OutputIntents { get; }
Public Property OutputIntents As OutputIntentList
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Package
Gets or sets the document package.
public DocumentPackage Package { get; set; }
Public Property Package As DocumentPackage
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Pages
Gets a PageList object that represents the pages of the Document .
public PageList Pages { get; }
Public Property Pages As PageList
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
PdfFormat
Gets or sets the PDF format for the PDF document.
public PdfFormat PdfFormat { get; set; }
Public Property PdfFormat As PdfFormat
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This property will determine whether the document is linearized or not.
PdfVersion
Gets or sets the PDF version of the PDF document.
public PdfVersion PdfVersion { get; set; }
Public Property PdfVersion As PdfVersion
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
PdfXVersion
Gets or sets the PDF/X version for the Document .
public PdfXVersion PdfXVersion { get; set; }
Public Property PdfXVersion As PdfXVersion
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Producer
Gets or sets a value indicating the producer of the Document .
public string Producer { get; set; }
Public Property Producer As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This value appears as a property of the generated PDF document.
ProductBuild
Gets the product build.
public static int ProductBuild { get; }
Public Shared Property ProductBuild As Int32
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
ProductVersion
Gets the product version.
public static Version ProductVersion { get; }
Public Shared Property ProductVersion As Version
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
ReaderEvents
Gets the reader events of the document.
public DocumentReaderEvents ReaderEvents { get; }
Public Property ReaderEvents As DocumentReaderEvents
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Sections
Gets a SectionList object for the Document .
public SectionList Sections { get; }
Public Property Sections As SectionList
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to break the document into different sections.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a template object and add a page numbering label
Dim template As Template = New Template
template.Elements.Add(New PageNumberingLabel("%%SP%% of %%ST%%", 0, 680, 512, 12, Font.Helvetica, 12, TextAlign.Center))
document.Template = template
'Begin the first section
document.Sections.Begin(NumberingStyle.RomanLowerCase)
'Add two pages
document.Pages.Add(New Page)
'Page 1
document.Pages.Add(New Page)
'Page 2
'Begin the second section
document.Sections.Begin(NumberingStyle.Numeric, template)
'Add three pages
document.Pages.Add(New Page)
'Page 3
document.Pages.Add(New Page)
'page 4
document.Pages.Add(New Page)
'page 5
'Begin the third section specifying a section prefix
document.Sections.Begin(NumberingStyle.RomanLowerCase, "Appendix A - ")
'Add two pages
document.Pages.Add(New Page)
'page 6
document.Pages.Add(New Page)
'page 7
' Save the PDF document
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
//Create a template object and add a page numbering label
Template template = new Template();
template.Elements.Add(new PageNumberingLabel("%%SP%% of %%ST%%", 0, 680, 512, 12, Font.Helvetica, 12, TextAlign.Center));
document.Template = template;
//Begin the first section
document.Sections.Begin(NumberingStyle.RomanLowerCase);
//Add two pages
document.Pages.Add(new Page()); //Page 1
document.Pages.Add(new Page()); //Page 2
//Begin the second section
document.Sections.Begin(NumberingStyle.Numeric, template);
//Add three pages
document.Pages.Add(new Page()); //Page 3
document.Pages.Add(new Page()); //page 4
document.Pages.Add(new Page()); //page 5
//Begin the third section specifying a section prefix
document.Sections.Begin(NumberingStyle.RomanLowerCase, "Appendix A - ");
//Add two pages
document.Pages.Add(new Page()); //page 6
document.Pages.Add(new Page()); //page 7
// Save the PDF document
document.Draw(outputPath);
}
}
Remarks
Used to break a document into sections. See the Document Sectioning topic for more details.
Security
Gets or sets an object to control the security and encryption of the Document .
public Security Security { get; set; }
Public Property Security As Security
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
The following example will set the RC4 128 bit security of the document so that anyone who logs in with the user password will not be able to print at high resolution, edit or add annotations or form fields, or access this document from other accessibility programs.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Add a page and add it to the document
Dim page As Page = New Page
document.Pages.Add(page)
'Create a RC4 128 bit security object
Dim security As RC4128Security = New RC4128Security("owner", "user")
' Set the permissions on that security object
security.AllowAccessibility = False
security.AllowDocumentAssembly = False
security.AllowUpdateAnnotsAndFields = False
' Add the security object to the document
document.Security = security
'Create and display a label as a reference
Dim text As String = "This document has been encrypted with RC4 128 bit encryption."
page.Elements.Add(New Label(text, 50, 50, 400, 100, Font.Helvetica, 18))
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.Cryptography;
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 );
// Create a RC4 128 bit security object RC4128Security security = new RC4128Security( "owner", "user" );
// Set the permissions on that security object security.AllowAccessibility = false; security.AllowDocumentAssembly = false; security.AllowUpdateAnnotsAndFields = false;
// Add the security object to the document document.Security = security;
// Create and display a label as a reference string text = "This document has been encrypted with RC4 128 bit encryption."; page.Elements.Add( new Label( text, 50, 50, 400, 100, Font.Helvetica, 18 ) );
// Save the PDF document.Draw( outputPath );}
}
Remarks
This object controls the encryption and security of the generated PDF 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.
public Template StampTemplate { get; set; }
Public Property StampTemplate As Template
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Subject
Gets or sets a value indicating the subject of the Document .
public string Subject { get; set; }
Public Property Subject As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This value appears as a property of the generated PDF document.
Tag
Gets or sets a value indicating whether document is tagged.
public TagOptions Tag { get; set; }
Public Property Tag As TagOptions
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
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.
public Template Template { get; set; }
Public Property Template As Template
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to create an EvenOddTemplate and Add it to the document.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
' Add 5 blank pages to the document
document.Pages.Add(New Page(PageSize.Letter))
document.Pages.Add(New Page(PageSize.Letter))
document.Pages.Add(New Page(PageSize.Letter))
document.Pages.Add(New Page(PageSize.Letter))
document.Pages.Add(New Page(PageSize.Letter))
'Create an even odd template and add elements to it
Dim template As EvenOddTemplate = New EvenOddTemplate
template.EvenElements.Add(New Label("Even Header", 0, 0, 200, 12))
template.OddElements.Add(New Label("Odd Header", 0, 0, 200, 12))
template.Elements.Add(New Label("Footer", 0, 680, 200, 12))
' Add the template to the document
document.Template = template
' Save the PDF document
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Add 5 blank pages to the document
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));
document.Pages.Add(new Page(PageSize.Letter));
// Create an even odd template and add elements to it
EvenOddTemplate template = new EvenOddTemplate();
template.EvenElements.Add(new Label("Even Header", 0, 0, 200, 12));
template.OddElements.Add(new Label("Odd Header", 0, 0, 200, 12));
template.Elements.Add(new Label("Footer", 0, 680, 200, 12));
// Add the template to the document
document.Template = template;
// Save the PDF document
document.Draw(outputPath);
}
}
Remarks
See the Templates topic for more on templates.
Title
Gets or sets a value indicating the title of the Document .
public string Title { get; set; }
Public Property Title As String
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This value appears as a property of the generated PDF document.
Trapped
Gets or sets a value indicating if trapping information is present in the Document .
public Trapped Trapped { get; set; }
Public Property Trapped As Trapped
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
ViewerPreferences
Gets a ViewerPreferences object that represents the viewer preferences of the Document .
public ViewerPreferences ViewerPreferences { get; }
Public Property ViewerPreferences As ViewerPreferences
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to change the viewer preferences associated with a document.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
' Create a page and add it to the document
document.Pages.Add(New Page(PageSize.Letter))
' Set the viewer preferences
document.ViewerPreferences.CenterWindow = True
document.ViewerPreferences.DisplayDocTitle = False
document.ViewerPreferences.HideMenubar = True
document.ViewerPreferences.HideToolbar = True
document.ViewerPreferences.HideWindowUI = True
' Save the PDF document
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
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
document.Pages.Add(new Page(PageSize.Letter));
// Set the viewer preferences
document.ViewerPreferences.CenterWindow = true;
document.ViewerPreferences.DisplayDocTitle = false;
document.ViewerPreferences.HideMenubar = true;
document.ViewerPreferences.HideToolbar = true;
document.ViewerPreferences.HideWindowUI = true;
// Save the PDF document
document.Draw(outputPath);
}
}
XmpMetadata
Gets or sets the XMP metadata for the PDF document.
public XmpMetadata XmpMetadata { get; set; }
Public Property XmpMetadata As XmpMetadata
Property Value
Licensing Info
This property is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to create XMP metadata and add it to the document.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
' Add blank pages to the document
document.Pages.Add(New Page(PageSize.Letter))
document.Pages.Add(New Page(PageSize.Letter))
'Create an Xmp Metadata
Dim xmp As XmpMetadata = New XmpMetadata
' Add the Xmp Metadata to the document
document.XmpMetadata = xmp
' Save the PDF document
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.Xmp;
public class Example
{
public static void CreatePDF(string outputPath)
{
// Create a PDF Document
Document document = new Document();
// Add blank pages to the document
document.Pages.Add( new Page( PageSize.Letter ) );
document.Pages.Add( new Page( PageSize.Letter ) );
// Create an Xmp Metadata
XmpMetadata xmp = new XmpMetadata();
// Add the Xmp Metadata to the document
document.XmpMetadata = xmp;
// Save the PDF document
document.Draw(outputPath);
}
}
Methods
AddLicense(String)
Adds a license key.
public static bool AddLicense(string licenseKey)
Shared Function AddLicense(licenseKey As String) As Boolean
Parameters
- licenseKey: String
The license key to add.
Returns
A boolean value indicating if the license is valid.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This method accepts a license key, not a serial number.
Certify(String, Certificate, Boolean, CertifyingPermission)
Certifies with signing and Time stamping the document digitally.
public void Certify(string fieldName, Certificate certificate, bool timeStamp, CertifyingPermission permission)
Sub Certify(fieldName As String, certificate As Certificate, timeStamp As Boolean, permission As CertifyingPermission)
Parameters
- fieldName: String
Field name of the signature.
- certificate: Certificate
Reference of type Certificate .
- timeStamp: Boolean
Timestamp the document using details from the certificate.
- permission: CertifyingPermission
CertifyingPermission for the signature.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to certify a PDF document with an invisible signature and Timestamp the signature.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page
Dim page As Page = New Page
' Add the page to the document
document.Pages.Add(page)
'Create a Certificate using the system default store
Dim certificate As Certificate = New Certificate("CertificateSubject")
' Certify the document - Invisible and mention to Timestamp the signature
document.Certify("NewFieldName", certificate, True, CertifyingPermission.AllowFormFilling)
' Save the document
document.Draw("C:\MyCertifiedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page();
// Add the page to the document
document.Pages.Add(page);
// Create a Certificate using the system default store
Certificate certificate = new Certificate("CertificateSubject");
// Certify the document - Invisible and mention to Timestamp the signature
document.Certify("NewFieldName", certificate, true, CertifyingPermission.AllowFormFilling);
// Save the document
document.Draw(@"C:\MyCertifiedDocument.pdf");
}
}
Remarks
This method is not available for .NET standard.
Certify(String, Certificate, CertifyingPermission)
Certifies with signing the document digitally.
public void Certify(string fieldName, Certificate certificate, CertifyingPermission permissions)
Sub Certify(fieldName As String, certificate As Certificate, permissions As CertifyingPermission)
Parameters
- fieldName: String
Field name of the signature.
- certificate: Certificate
Reference of type Certificate .
- permissions: CertifyingPermission
CertifyingPermission for the signature.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to certify a PDF document with an invisible signature.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page
Dim page As Page = New Page
' Add the page to the document
document.Pages.Add(page)
'Create a Certificate using the system default store
Dim certificate As Certificate = New Certificate("Certificate Subject")
' Certify the document - Invisible
document.Certify("NewFieldName", certificate, CertifyingPermission.AllowFormFilling)
' Save the document
document.Draw("C:\MyCertifiedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page();
// Add the page to the document
document.Pages.Add(page);
// Create a Certificate using the system default store
Certificate certificate = new Certificate("Certificate Subject");
// Certify the document - Invisible
document.Certify("NewFieldName", certificate, CertifyingPermission.AllowFormFilling);
// Save the document
document.Draw(@"C:\MyCertifiedDocument.pdf");
}
}
Remarks
This method is not available for .NET standard.
Certify(String, Certificate, TimestampServer, CertifyingPermission)
Certifies with signing and Time stamping the document digitally.
public void Certify(string fieldName, Certificate certificate, TimestampServer timestampServer, CertifyingPermission permission)
Sub Certify(fieldName As String, certificate As Certificate, timestampServer As TimestampServer, permission As CertifyingPermission)
Parameters
- fieldName: String
Field name of the signature.
- certificate: Certificate
Reference of type Certificate .
- timestampServer: TimestampServer
Reference of type TimestampServer .
- permission: CertifyingPermission
CertifyingPermission for the signature.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to certify a PDF document with an invisible signature and Timestamp the signature.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page
Dim page As Page = New Page
' Add the page to the document
document.Pages.Add(page)
'Create a Certificate using the system default store
Dim certificate As Certificate = New Certificate("CertificateSubject")
'Create a TimestampServer by passing the Url of the server.
Dim timestampServer As TimestampServer = New TimestampServer("http://TimestampServerURL")
' Certify and timestamp the document - Invisible
document.Certify("NewFieldName", certificate, timestampServer, CertifyingPermission.AllowFormFilling)
' Save the document
document.Draw("C:\MyCertifiedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page();
// Add the page to the document
document.Pages.Add(page);
// Create a Certificate using the system default store
Certificate certificate = new Certificate("CertificateSubject");
// Create a TimestampServer by passing the Url of the server.
TimestampServer timestampServer = new TimestampServer("http://TimestampServerURL");
// Certify and timestamp the document - Invisible
document.Certify("NewFieldName", certificate, timestampServer, CertifyingPermission.AllowFormFilling);
// Save the document
document.Draw(@"C:\MyCertifiedDocument.pdf");
}
}
Remarks
This method is not available for .NET standard.
Certify(String, SigningProvider, CertifyingPermission)
Certifies with signing and Time stamping the document digitally.
public void Certify(string fieldName, SigningProvider externalSigningProvider, CertifyingPermission permission)
Sub Certify(fieldName As String, externalSigningProvider As SigningProvider, permission As CertifyingPermission)
Parameters
- fieldName: String
Field name of the signature.
- externalSigningProvider: SigningProvider
Reference of type SigningProvider .
- permission: CertifyingPermission
CertifyingPermission for the signature.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Remarks
This method is not available for .NET standard.
Draw()
Outputs the generated Document to a byte array.
public Byte[] Draw()
Function Draw() As Byte()
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Exceptions
GeneratorException The PDF could not be created because of an internal problem.
PdfParsingException If DynamicPDF is being used and one of the input PDF files cannot be parsed because it is likely corrupt or invalid.
Examples
This example shows how to output the PDF to a byte array.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page and add it to the document
Dim page As 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 to a byte array
Dim pdfData() As Byte = document.Draw()
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF()
{
// 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 to a byte array
byte[] pdfData = document.Draw();
}
}
Draw(Stream)
Outputs the generated Document to the given Stream object.
public void Draw(Stream stream)
Sub Draw(stream As Stream)
Parameters
- stream: Stream
Stream object that receive the Document output.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Exceptions
GeneratorException The PDF could not be created because of an internal problem.
PdfParsingException If DynamicPDF is being used and one of the input PDF files cannot be parsed because it is likely corrupt or invalid.
TimestampException If there was failure in the connection or if there is no Timestamp Info present.
Examples
This example shows how to output the document to a memory stream object.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page and add it to the document
Dim page As 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))
'Create a memory stream object to save to
Dim outputStream As MemoryStream = New MemoryStream
' Output the PDF to the MemoryStream
document.Draw(outputStream)
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
public class Example
{
public static void CreatePDF()
{
// 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));
// Create a memory stream object to save to
MemoryStream outputStream = new MemoryStream();
// Output the PDF to the MemoryStream
document.Draw(outputStream);
}
}
Draw(String)
Outputs the generated Document to a file.
public void Draw(string filePath)
Sub Draw(filePath As String)
Parameters
- filePath: String
File path to store the Document.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Exceptions
GeneratorException The PDF could not be created because of an internal problem.
PdfParsingException If DynamicPDF is being used and one of the input PDF files cannot be parsed because it is likely corrupt or invalid.
Examples
This example shows how to output the PDF to a file.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
' Add a page and add it to the document
Dim page As 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)
End Sub
End Module
using System;
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 );
}
}
Equals(Object)
Determines whether the specified Object is equal to the current Object . (Inherited from Object)
public bool Equals(Object obj)
Function Equals(obj As Object) As Boolean
Parameters
- obj: Object
The Object to compare with the current Object .
Returns
true if the specified Object is equal to the current Object ; otherwise, false.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
FromHtml(Stream, PageDimensions, HtmlAreaPadding)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(Stream stream, PageDimensions dimensions, HtmlAreaPadding padding)
Shared Function FromHtml(stream As Stream, dimensions As PageDimensions, padding As HtmlAreaPadding) As Document
Parameters
- stream: Stream
Stream object containing the HTML contents data.
- dimensions: PageDimensions
Page dimensions for HTML Area
- padding: HtmlAreaPadding
Padding for HTML Area
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a stream
Dim stream As System.IO.Stream = File.OpenRead(inputHTMLPath)
'Create a HtmlAreaPadding
Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)
'Create a PDF Document
Dim document As Document = document.FromHtml(stream, dimensions, padding)
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using System.IO;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
// Create a stream
Stream stream = File.OpenRead(inputHTMLPath);
// Create a HtmlAreaPadding
HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
// Create a PDF Document
Document document = Document.FromHtml(stream, dimensions, padding);
// Save the PDF
document.Draw(outputPath);
}
}
FromHtml(Stream, PageDimensions, HtmlAreaPadding, Uri)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(Stream stream, PageDimensions dimensions, HtmlAreaPadding padding, Uri baseHref)
Shared Function FromHtml(stream As Stream, dimensions As PageDimensions, padding As HtmlAreaPadding, baseHref As Uri) As Document
Parameters
- stream: Stream
Stream object containing the HTML contents data.
- dimensions: PageDimensions
Page dimensions for HTML Area
- padding: HtmlAreaPadding
Padding for HTML Area
- baseHref: Uri
Initializes a new instance of the Uri class with the specified base href URI.
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a stream
Dim stream As Stream = System.IO.File.OpenRead(inputHTMLPath)
'Create a baseHref
Dim baseHref As Uri = New Uri(baseHrefPath)
'Create a HtmlAreaPadding
Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)
'Create a PDF Document
Dim document As Document = Document.FromHtml(stream, dimensions, padding, baseHref)
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string baseHrefPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
// Create a stream
Stream stream = System.IO.File.OpenRead(inputHTMLPath);
// Create a baseHref
Uri baseHref = new Uri(baseHrefPath);
// Create a HtmlAreaPadding
HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
// Create a PDF Document
Document document = Document.FromHtml(stream, dimensions, padding, baseHref);
// Save the PDF
document.Draw(outputPath);
}
}
FromHtml(Stream, PageDimensions, Uri)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(Stream stream, PageDimensions dimensions, Uri baseHref)
Shared Function FromHtml(stream As Stream, dimensions As PageDimensions, baseHref As Uri) As Document
Parameters
- stream: Stream
Stream object containing the HTML contents data.
- dimensions: PageDimensions
Page dimensions for HTML Area.
- baseHref: Uri
Initializes a new instance of the Uri class with the specified base href URI.
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a stream
Dim stream As Stream = System.IO.File.OpenRead(inputHTMLPath)
'Create a baseHref
Dim baseHref As Uri = New Uri(baseHrefPath)
'Create a PDF Document
Dim document As Document = document.FromHtml(stream, dimensions, baseHref)
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string baseHrefPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
// Create a stream
Stream stream = System.IO.File.OpenRead(inputHTMLPath);
// Create a baseHref
Uri baseHref = new Uri(baseHrefPath);
// Create a PDF Document
Document document = Document.FromHtml(stream, dimensions, baseHref);
// Save the PDF
document.Draw(outputPath);
}
}
FromHtml(String, PageDimensions, HtmlAreaPadding)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(string filePath, PageDimensions dimensions, HtmlAreaPadding padding)
Shared Function FromHtml(filePath As String, dimensions As PageDimensions, padding As HtmlAreaPadding) As Document
Parameters
- filePath: String
Physical location of the HTML file.
- dimensions: PageDimensions
Page dimensions for HTML Area
- padding: HtmlAreaPadding
Padding for HTML Area
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a HtmlAreaPadding
Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)
'Create a PDF Document
Dim document As Document = Document.FromHtml(inputHTMLPath, dimensions, padding)
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
// Create a HtmlAreaPadding
HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
// Create a PDF Document
Document document = Document.FromHtml(inputHTMLPath, dimensions, padding);
// Save the PDF
document.Draw(outputPath);
}
}
FromHtml(String, PageDimensions, HtmlAreaPadding, Uri)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(string filePath, PageDimensions dimensions, HtmlAreaPadding padding, Uri baseHref)
Shared Function FromHtml(filePath As String, dimensions As PageDimensions, padding As HtmlAreaPadding, baseHref As Uri) As Document
Parameters
- filePath: String
Physical location of the HTML file.
- dimensions: PageDimensions
Page dimensions for HTML Area
- padding: HtmlAreaPadding
Padding for HTML area
- baseHref: Uri
Initializes a new instance of the Uri class with the specified base href URI.
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a baseHref
Dim baseHref As Uri = New Uri(baseHrefPath)
'Create a HtmlAreaPadding
Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)
'Create a PDF Document
Dim document As Document = Document.FromHtml(inputHTMLPath, dimensions, padding, baseHref)
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string baseHrefPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
// Create a baseHref
Uri baseHref = new Uri(baseHrefPath);
// Create a HtmlAreaPadding
HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
// Create a PDF Document
Document document = Document.FromHtml(inputHTMLPath, dimensions, padding, baseHref);
// Save the PDF
document.Draw(outputPath);
}
}
FromHtml(String, PageDimensions, Uri)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(string filePath, PageDimensions dimensions, Uri baseHref)
Shared Function FromHtml(filePath As String, dimensions As PageDimensions, baseHref As Uri) As Document
Parameters
- filePath: String
Physical location of the HTML file.
- dimensions: PageDimensions
Page dimensions for HTML Area.
- baseHref: Uri
Initializes a new instance of the Uri class with the specified base href URI.
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a baseHref
Dim baseHref As Uri = New Uri(baseHrefPath)
'Create a PDF Document
Dim document As Document = document.FromHtml(inputHTMLPath, dimensions, baseHref)
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string baseHrefPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
// Create a baseHref
Uri baseHref = new Uri(baseHrefPath);
// Create a PDF Document
Document document = Document.FromHtml(inputHTMLPath, dimensions, baseHref);
// Save the PDF
document.Draw(outputPath);
}
}
FromHtml(Uri, PageDimensions, HtmlAreaPadding)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(Uri uri, PageDimensions dimensions, HtmlAreaPadding padding)
Shared Function FromHtml(uri As Uri, dimensions As PageDimensions, padding As HtmlAreaPadding) As Document
Parameters
- uri: Uri
Initializes a new instance of the Uri class with the specified URI.
- dimensions: PageDimensions
Page dimensions for HTML Area
- padding: HtmlAreaPadding
Padding for HTML Area
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a uri
Dim uri As Uri = New Uri(inputHTMLPath)
'Create a HtmlAreaPadding
Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)
'Create a PDF Document
Dim document As Document = Document.FromHtml(uri, dimensions, padding)
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
// Create a uri
Uri uri = new Uri(inputHTMLPath);
// Create a HtmlAreaPadding
HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
// Create a PDF Document
Document document = Document.FromHtml(uri, dimensions, padding);
// Save the PDF
document.Draw(outputPath);
}
}
FromHtml(Uri, PageDimensions, HtmlAreaPadding, Uri)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(Uri uri, PageDimensions dimensions, HtmlAreaPadding padding, Uri baseHref)
Shared Function FromHtml(uri As Uri, dimensions As PageDimensions, padding As HtmlAreaPadding, baseHref As Uri) As Document
Parameters
- uri: Uri
Initializes a new instance of the Uri class with the specified URI.
- dimensions: PageDimensions
Page dimensions for HTML Area
- padding: HtmlAreaPadding
Padding for HTML Area
- baseHref: Uri
Initializes a new instance of the Uri class with the specified base href URI.
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a uri
Dim uri As Uri = New Uri(inputHTMLPath)
'Create a HtmlAreaPadding
Dim padding As HtmlAreaPadding = New HtmlAreaPadding(20.0, 0.0, 20.0, 0.0)
'Create a baseHref
Dim baseHref As Uri = New Uri(baseUriPath)
'Create a PDF Document
Dim document As Document = Document.FromHtml(uri, dimensions, padding, baseHref)
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string baseUriPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
// Create a Uri
Uri uri = new Uri(inputHTMLPath);
// Create a HtmlAreaPadding
HtmlAreaPadding padding = new HtmlAreaPadding(20.0f, 0.0f, 20.0f, 0.0f);
// Create a baseHref
Uri baseHref = new Uri(baseUriPath);
// Create a PDF Document
Document document = Document.FromHtml(uri, dimensions, padding, baseHref);
// Save the PDF
document.Draw(outputPath);
}
}
FromHtml(Uri, PageDimensions, Uri)
Gets a Document containing HtmlArea created with the given content.
public static Document FromHtml(Uri uri, PageDimensions dimensions, Uri baseHref)
Shared Function FromHtml(uri As Uri, dimensions As PageDimensions, baseHref As Uri) As Document
Parameters
- uri: Uri
Initializes a new instance of the Uri class with the specified URI.
- dimensions: PageDimensions
Page dimensions for HTML Area.
- baseHref: Uri
Initializes a new instance of the Uri class with the specified base href URI.
Returns
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows simple HTML being displayed on the page.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Imports ceTe.DynamicPDF.PageElements.Html
Module MyModule
Sub Main()
'Create a PageDimensions
Dim dimensions As PageDimensions = New PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0)
'Create a uri
Dim uri As Uri = New Uri(inputHTMLPath)
'Create a baseHref
Dim baseHref As Uri = New Uri(baseUriPath)
'Create a PDF Document
Dim document As Document = Document.FromHtml(uri, dimensions, baseHref)
'Create a PDF Document
' Save the PDF
document.Draw(outputPath)
End Sub
End Module
using System;
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements;
using ceTe.DynamicPDF.PageElements.Html;
public class Example
{
public static void CreatePDF(string inputHTMLPath, string baseUriPath, string outputPath)
{
// Create a PageDimensions
PageDimensions dimensions = new PageDimensions(PageSize.Letter, PageOrientation.Portrait, 50.0f);
//Create a Uri
Uri uri = new Uri(inputHTMLPath);
// Create a baseHref
Uri baseHref = new Uri(baseUriPath);
// Create a PDF Document
Document document = Document.FromHtml(uri, dimensions, baseHref);
// Save the PDF
document.Draw(outputPath);
}
}
GetHashCode()
Serves as a hash function for a particular type. (Inherited from Object)
public int GetHashCode()
Function GetHashCode() As Integer
Returns
A hash code for the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
GetType()
Gets the Type of the current instance. (Inherited from Object)
public Type GetType()
Function GetType() As Type
Returns
The Type instance that represents the exact runtime type of the current instance.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Sign(String, Certificate)
Sign this document digitally.
public void Sign(string fieldName, Certificate certificate)
Sub Sign(fieldName As String, certificate As Certificate)
Parameters
- fieldName: String
Field name of the signature.
- certificate: Certificate
Reference of type Certificate
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Exceptions
GeneratorException If the document is signed more than once.
Examples
This example shows how to sign a PDF document with an invisible signature.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page and add it to the document
Dim page As Page = New Page
' Add the page to the document
document.Pages.Add(page)
'Create a Certificate using the system default store
certificate As Certificate = New Certificate("CertificateSubject")
' Sign the document - Invisible
document.Sign("NewFieldName", certificate)
' Save the document
document.Draw("C:\MySignedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page();
// Add the page to the document
document.Pages.Add(page);
// Create a Certificate using the system default store
Certificate certificate = new Certificate("CertificateSubject");
// Sign the document - Invisible
document.Sign("NewFieldName", certificate);
// Save the document
document.Draw(@"C:\MySignedDocument.pdf");
}
}
Remarks
NOTE: This method requires the .NET Framework 2.0 or greater.
To sign with visible signature, give the Signature field name which is already added into any of the document pages. To sign with invisible, use a different name which does not assign for any of the page elements added into this document pages. Giving existing field name of other page elements apart from Signature will make the document unsigned. This method is not available for .NET standard.
Sign(String, Certificate, Boolean)
Digitally sign this document with Time stamping.
public void Sign(string fieldName, Certificate certificate, bool timeStamp)
Sub Sign(fieldName As String, certificate As Certificate, timeStamp As Boolean)
Parameters
- fieldName: String
Field name of the signature.
- certificate: Certificate
Reference of type Certificate .
- timeStamp: Boolean
Timestamp the document using details from the certificate.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Exceptions
GeneratorException If the document is signed more than once.
Examples
This example shows how to sign a PDF document with an invisible signature and Timestamp the signature.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page
Dim page As Page = New Page
' Add the page to the document
document.Pages.Add(page)
'Create a Certificate using the system default store
Dim certificate As Certificate = New Certificate("CertificateSubject")
' Sign the document - Invisible and mention to Timestamp the signature
document.Sign("NewFieldName", certificate, True)
' Save the document
document.Draw("C:\MyTimestampedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page();
// Add the page to the document
document.Pages.Add(page);
// Create a Certificate using the system default store
Certificate certificate = new Certificate("CertificateSubject");
// Sign the document - Invisible and mention to Timestamp the signature
document.Sign("NewFieldName", certificate, true);
// Save the document
document.Draw(@"C:\MyTimestampedDocument.pdf");
}
}
Remarks
This method is not available for .NET standard.
Sign(String, Certificate, TimestampServer)
Digitally sign this document with Time stamping.
public void Sign(string fieldName, Certificate certificate, TimestampServer timestampServer)
Sub Sign(fieldName As String, certificate As Certificate, timestampServer As TimestampServer)
Parameters
- fieldName: String
Field name of the signature.
- certificate: Certificate
Reference of type Certificate .
- timestampServer: TimestampServer
Reference of type TimestampServer .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Exceptions
GeneratorException If the document is signed more than once.
Examples
This example shows how to sign a PDF document with an invisible signature and Timestamp the signature.
Imports System
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements
Module MyModule
Sub Main()
'Create a PDF Document
Dim document As Document = New Document
'Create a Page and add it to the document
Dim page As Page = New Page
' Add the page to the document
document.Pages.Add(page)
'Create a Certificate using the system default store
Dim certificate As Certificate = New Certificate("CertificateSubject")
'Create a TimestampServer by passing the Url of the server.
Dim timestampServer As TimestampServer = New TimestampServer("http://ServerURL")
' Sign and timestamp the document - Invisible
document.Sign("NewFieldName", certificate, timestampServer)
' Save the document
document.Draw("C:\MyTimestampedDocument.pdf")
End Sub
End Module
using System;
using ceTe.DynamicPDF;
class MyClass
{
static void Main(string[] args)
{
// Create a PDF Document
Document document = new Document();
// Create a PDF Page
Page page = new Page();
// Add the page to the document
document.Pages.Add(page);
// Create a Certificate using the system default store
Certificate certificate = new Certificate("CertificateSubject");
// Create a TimestampServer by passing the Url of the server.
TimestampServer timestampServer = new TimestampServer("http://ServerURL");
// Sign and timestamp the document - Invisible
document.Sign("NewFieldName", certificate, timestampServer);
// Save the document
document.Draw(@"C:\MyTimestampedDocument.pdf");
}
}
Remarks
This method is not available for .NET standard.
Sign(String, SigningProvider)
Digitally sign this document with SigningProvider.
public void Sign(string fieldName, SigningProvider externalSigningProvider)
Sub Sign(fieldName As String, externalSigningProvider As SigningProvider)
Parameters
- fieldName: String
Field name of the signature.
- externalSigningProvider: SigningProvider
Reference of type SigningProvider .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Exceptions
GeneratorException If the document is signed more than once.
Remarks
If the document is set for Time stamping then the Certificate should contain the details for Time stamping.
Timestamp(String, SigningProvider)
Marks the document to add a timestamp to the existing signature filed.
public void Timestamp(string signatureFieldName, SigningProvider signingProvider)
Sub Timestamp(signatureFieldName As String, signingProvider As SigningProvider)
Parameters
- signatureFieldName: String
Name of a signature field that is already exsit in the document.
- signingProvider: SigningProvider
Signing provider to be used for timestamping the document.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to Timestamp the PDF with External Sign Provider.
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.Forms
Imports ceTe.DynamicPDF.Merger
Module MyModuleSub CreatePDFTimeStampSigningProvider(outPath As String, externalSigningProviderWithTimeStamp As SigningProvider)
Dim document As Document = New Document()
Dim page As Page = New Page()
document.Pages.Add(page)
'Add a signature field to the page
Dim signature As Signature = New Signature("SignField", 10, 110, 100, 100)
page.Elements.Add(signature)
'Specifying External Signing Provider for Timestamping.
document.Timestamp("SignField", externalSigningProviderWithTimeStamp)
'Save the document
document.Draw(outPath)
End Sub
End Module
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Forms;
using ceTe.DynamicPDF.Merger;
class Example
{public static void CreatePDFTimeStampSigningProvider(string outPath, SigningProvider externalSigningProviderWithTimeStamp)
{
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
// Add a signature field to the page
Signature signature = new Signature("SigFieldName", 10, 110, 100, 100);
page.Elements.Add(signature);
// Specifying External Signing Provider for Timestamping.
document.Timestamp("SigningField", externalSigningProviderWithTimeStamp);
// Save the document
document.Draw(outPath);
}
}
Remarks
Actual timestamping happens at the time of creating the PDF content in the Draw method.
A document can be either signed or certified or timestamped. For signing or certifying and document timestamp it has to be done through multiple incremental updates.
Timestamp(String, TimestampServer)
Marks the document to add a timestamp to the existing signature filed.
public void Timestamp(string signatureFieldName, TimestampServer timestampServer)
Sub Timestamp(signatureFieldName As String, timestampServer As TimestampServer)
Parameters
- signatureFieldName: String
Name of a signature field that is already exsit in the document.
- timestampServer: TimestampServer
Timestamp server to be used for timestamping the document.
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.
Examples
This example shows how to Timestamp the PDF with timestamp server.
Imports ceTe.DynamicPDF
Imports ceTe.DynamicPDF.PageElements.Forms
Imports ceTe.DynamicPDF.Merger
Module MyModule
Sub CreatePDFTimeStampServer(outpath As String)
Dim document As Document = New Document()
Dim page As Page = New Page()
document.Pages.Add(page)
'Add a signature field to the page
Dim signature As Signature = New Signature("SignField", 10, 110, 100, 100)
page.Elements.Add(signature)
'Specifying TimeStamp Server URL for Timestamping.
Dim timestampServer As TimestampServer = New TimestampServer("TimeStamp Server URL")
document.Timestamp("SignField", timestampServer)
'Save the document
document.Draw(outpath)
End Sub
End Module
using ceTe.DynamicPDF;
using ceTe.DynamicPDF.PageElements.Forms;
using ceTe.DynamicPDF.Merger;
class Example
{public static void CreatePDFTimeStampServer(string outPath)
{
Document document = new Document();
Page page = new Page();
document.Pages.Add(page);
// Add a signature field to the page
Signature signature = new Signature("SigningField", 10, 110, 100, 100); page.Elements.Add(signature);
// Specifying TimeStamp Server URL for Timestamping.
TimestampServer timestampServer = new TimestampServer("TimeStamp Server URL");
document.Timestamp("SigningField", timestampServer);
// Save the document
document.Draw(outPath);
}
}
Remarks
Actual timestamping happens at the time of creating the PDF content in the Draw method.
A document can be either signed or certified or timestamped. For signing or certifying and document timestamp it has to be done through multiple incremental updates.
ToString()
Returns a String that represents the current Object . (Inherited from Object)
public string ToString()
Function ToString() As String
Returns
A String that represents the current Object .
Licensing Info
This method is a full DynamicPDF Core Suite feature. One of the following is required for non-evaluation usage:
- An active DynamicPDF Ultimate Subscription
- An active DynamicPDF Professional or Professional Plus Subscription with DynamicPDF Core Suite selected.
- A DynamicPDF Core Suite for .NET v12.X Developer License.