EVO HTML to PDF Converter

Document Class

EVO HTML to PDF Converter for .NET Documentation
This class encapsulates a PDF document and can be used to create a new PDF document or to load an existing PDF document
Inheritance Hierarchy

SystemObject
  EvoPdfDocument

Namespace:  EvoPdf
Assembly:  evohtmltopdf (in evohtmltopdf.dll) Version: 10.0.0.0
Syntax

public class Document

The Document type exposes the following members.

Constructors

  NameDescription
Public methodDocument
Creates an empty PDF document object. New pages can be added to the document and new PDF elements can be added to document pages.
Public methodDocument(ColorProfile)
Creates a PDF document with a color profile.
Public methodDocument(ColorSpace)
Creates a PDF document with the specified color space. This property can be used to create PDF documents in RGB, Grayscale or CMYK color spaces. By default the document uses the RGB color space.
Public methodDocument(PdfStandardSubset)
Creates a PDF document based on the specified PDF standard. By default the Full PDF standard is used. This property can be used to create PDF/A or PDF/X compliant documents.
Public methodDocument(Stream)
Creates a PDF document object from the specified stream containing the PDF document.
Public methodDocument(String)
Creates a PDF document from and existing PDF file.
Public methodDocument(PdfStandardSubset, ColorSpace)
Creates a PDF document based on the specified PDF standard and using the specified color space. By default the Full PDF standard is used. This property can be used to create PDF/A or PDF/X compliant documents using the specified color space.
Public methodDocument(Stream, String)
Creates a PDF document from a stream containing a password protected PDF document. The specified password can be a user or owner password.
Public methodDocument(String, String)
Creates a PDF document object from an existing password protected PDF file.
Public methodDocument(PdfStandardSubset, ColorSpace, ColorProfile)
Creates a PDF document based on the specified PDF standard and using the specified color space and color profile. By default the Full PDF standard is used. This property can be used to create PDF/A or PDF/X compliant documents using the specified color space.
Top
Properties

  NameDescription
Public propertyAutoCloseAppendedDocs
Gets or sets a value indicating if the PDF documents appended to this document using the AppendDocument(Document) method are automatically closed when the current document is closed using the Close method. The default value is false. The appended documents must remain open until the current document is saved.
Public propertyBookmarks
Gets the bookmarks collection of the document.
Public propertyCompressCrossReference
Set this property on true to store the PDF cross-reference table and PDF trailer in compressed cross-reference streams and to reduce the PDF file size. The default value is false for the new documents
Public propertyCompressionLevel
Gets or sets the PDF document compression level. By default the compression level is Normal
Public propertyDocumentInformation
Offers access to the document information object where the document's title, subject, keywords, etc can be set.
Public propertyFonts
Gets the collection of fonts of this PDF document.
Public propertyFooter
Represents the default PDF document footer template. This footer is automatically considered when calculating the available space for rendering in a PDF page. This template is automatically docked to the bottom of the PDF page.
Public propertyForm
Gets a reference to the PDF form of this PDF document
Public propertyHeader
Represents the default PDF document header template. This header is automatically considered when calculating the available space for drawing in a PDF page. This template is automatically docked to the top of the PDF page.
Public propertyJpegCompressionEnabled
Gets or sets a flag indicating if the JPEG compression is enabled or not for the images in the generated PDF. By default the JPEG compression is enabled to reduce the size of the generated PDF. When the JPEG compression is enabled the quality of the images in the generated PDF is lower than the quality of the original images in the HTML document, function of the JpegCompressionLevel parameter. When the JpegCompressionLevel is increased, the quality of the images in PDF decreases.
Public propertyJpegCompressionLevel
Gets or sets the compression level of images in the generated PDF as an integer value between 0 and 100. This property has effect only when the JpegCompressionEnabled is true. When the JpegCompressionLevel is 0, the compression rate is the lowest and the quality of the images is the best. When the JpegCompressionLevel is 100, the compression rate is the highest and quality of the images in PDF is the worst. The default JPEG compression level is 10, which should offer a good balance between the compression rate and the quality of the images in PDF.
Public propertyLicenseKey
Gets or sets the license key string received from the vendor. If this property is null the library will automatically enter in evaluation mode and a demo watermark will be displayed on the generated PDF document.
Public propertyMargins
The default document margins. The new pages will use the default margins if no margins are specified
Public propertyOpenAction
The Go To, JavaScript, Submit Form or Reset Form action to be performed when the PDF document is opened.
Public propertyPages
Gets the collection of pages of this PDF document.
Public propertySecurity
Offers access to security features of the PDF document like encryption.
Public propertyTableOfContents
Gets a reference to the object controlling the automatic creation of a table of contents in the generated PDF document based on HtmlToPdfElement and HtmlToImageElement objects added to PDF document
Public propertyTemplates
Gets the collection of templates of this PDF document.
Public propertyTransparencyEnabled
Gets or sets a flag indicating if the transparency is enabled in the PDF document. Default value is true. This property can be set to false to eliminate the additional flattening time when the document is sent to the printer from Adobe Reader viewer.
Public propertyViewerPreferences
Offers access to the viewer preferences settings for the document.
Top
Methods

  NameDescription
Public methodAddBookmark(String, ExplicitDestination)
Creates a root bookmark for the document
Public methodAddBookmark(String, ExplicitDestination, Bookmark)
Creates a child bookmark for the existing parentBookmark
Public methodAddFileAttachment(String)
Adds an attachment a given file to this PDF document
Public methodAddFileAttachment(Stream, String)
Adds an attachment with the given name from a stream to this PDF document
Public methodAddFileAttachment(String, String)
Adds an attachment a given file and given description to this PDF document
Public methodAddFileAttachment(Stream, String, String)
Adds an attachment with the given name and a given description from a stream to this PDF document
Public methodAddFont(Byte)
Adds a system font to the fonts collection. The font is created from the specified font data. If the font was already added the method returns the existing font.
Public methodAddFont(Font)
Adds a system font to the fonts collection. If the font was already added the method returns the existing font. By default the font is embedded in the PDF document in order to support Unicode texts.
Public methodAddFont(StandardCJKFont)
Adds a standard CJK font to the collection. If the font was already added the method returns the existing font.
Public methodAddFont(StdFontBaseFamily)
Adds a standard font to the fonts collection. If the font was already added the method returns the existing font.
Public methodAddFont(String)
Adds a system font to the fonts collection. The font is created from the specified file. If the font was already added the method returns the existing font.
Public methodAddFont(Font, Boolean)
Adds a system font to the fonts collection. If the font was already added the method returns the existing font. The embedFont property indicates if the added font will be embedded into the PDF document.
Public methodAddFont(Byte, Single, FontStyle)
Adds a system font to the fonts collection. The font is created from the specified font data with the specified style. If the font was already added the method returns the existing font.
Public methodAddFont(String, Single, FontStyle)
Adds a system font to the fonts collection. The font is created from the specified file with the specified style. If the font was already added the method returns the existing font.
Public methodAddFooterTemplate
Adds a footer with the given height to document
Public methodAddHeaderTemplate
Adds a header with the given height to document
Public methodAddPage
Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the orientation and size are inherited from the that page otherwise a first page with the default A4 size and Portrait orientation is created. The page margins are inherited from the default document margins
Public methodAddPage(Margins)
Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the orientation and size are inherited from the that page otherwise a first page with the default A4 size and Portrait orientation is created
Public methodAddPage(PdfPage)
Adds the specified page to the document pages collection. The page to be added is allowed to be from another document. The source document of the page to be added must remain opened until the current document is saved.
Public methodAddPage(PdfPageSize, Margins)
Creates a new PDF page and adds it to the collection. If there is a previous page in the collection, the page orientation is inherited from the that page otherwise a first page with the specified size and Portrait orientation is created
Public methodAddPage(PdfPageSize, Margins, PdfPageOrientation)
Creates a new PDF page with the specified size, margins and orientation and adds it to the collection
Public methodAddTemplate(RectangleF)
Adds a new template with the specified bounds to the document templates collection.
Public methodAddTemplate(Single, Single)
Adds a new template with the specified width and height to the document templates collection. The template location is top left corner of the page.
Public methodAppendDocument(Document)
Appends the document given as parameter to the current document. The appended document must remain open until the current document is saved
Public methodAppendDocument(Document, Int32, Int32)
Appends a range of pages from the document given as parameter to the current document. The appended document must remain open until the current document is saved
Public methodAppendDocument(Document, Boolean, Boolean, Boolean)
Appends the document given as parameter to the current document and optionally applies the current document header and footer to the appended document pages if the appended document was loaded from an external file or stream
Public methodAppendDocument(Document, Int32, Int32, Boolean, Boolean, Boolean)
Appends a range of pages from the document given as parameter to the current document and optionally applies the current document header and footer to the appended document pages if the appended document was loaded from an external file or stream
Public methodClose
Releases all the resources allocated by this PDF document. Always call this method after the document was saved. If the document was created from a stream or file, the stream will be closed if it was not explicitly detached by calling the DetachStream() before the document is closed.
Public methodDetachStream
Call this method to detach the stream from which this document was created. When this method is called before calling Close(), the Close method will not close the detached stream.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodStatic memberGetPageCount(Stream)
A fast method to obtain the page count of a PDF document from the given stream.
Public methodStatic memberGetPageCount(String)
A fast method to obtain the page count of a PDF document from the given file path.
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodInsertDocument(Int32, Document)
Inserts the document given as parameter in the current document at the given page index. The appended document must remain open until the current document is saved
Public methodInsertDocument(Int32, Document, Int32, Int32)
Inserts a range of pages from the document given as parameter in the current document at the given page index. The appended document must remain open until the current document is saved
Public methodInsertDocument(Int32, Document, Boolean, Boolean, Boolean)
Inserts the document given as parameter to the current document and optionally applies the current document header and footer to the appended document pages if the appended document was loaded from an external file or stream
Public methodInsertDocument(Int32, Document, Int32, Int32, Boolean, Boolean, Boolean)
Inserts a range of pages from the document given as parameter to the current document and optionally applies the current document header and footer to the appended document pages if the appended document was loaded from an external file or stream
Public methodInsertPage(Int32, PdfPage)
Inserts the specified page into the document pages collection given by the Pages property at the specified index. The page to be added is allowed to be from another document. The source document of the page to be inserted must remain opened until the current document is saved.
Public methodInsertPage(Int32, PdfPageSize, Margins, PdfPageOrientation)
Creates a new PDF page with the specified size, margins and orientation and inserts it into the collection at the specified index.
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodRemovePage(Int32)
Removes the PDF page at the specified index in pages collection.
Public methodRemovePage(PdfPage)
Removes the specified PDF page from the pages collection of this document.
Public methodSave
Saves the PDF document as byte array that can be further saved into a file or sent over HTTP to a browser.
Public methodSave(Stream)
Saves this PDF document into the specified output stream.
Public methodSave(String)
Saves this PDF document into the file given by the method parameter
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Events

  NameDescription
Public eventExternalPdfPageAddedEvent
The event is raised after a page from an external PDF document is added to this document
Top
See Also

Reference