Class for PDF document processing. This class can be used to create, read, merge or compare files in Portable Document Format.

Inheritance Hierarchy

System.Object
  BitMiracle.Docotic.Pdf.PdfDocument

Namespace:  BitMiracle.Docotic.Pdf
Assembly:  BitMiracle.Docotic.Pdf (in BitMiracle.Docotic.Pdf.dll)

Syntax

C#
public sealed class PdfDocument : IDisposable
VB
Public NotInheritable Class PdfDocument
	Implements IDisposable

The PdfDocument type exposes the following members.

Constructors

  NameDescription
Public methodPdfDocument()
Creates a new blank PDF document.
Public methodPdfDocument(Byte[])
Opens an existing PDF document.
Public methodPdfDocument(Stream)
Opens an existing PDF document.
Public methodPdfDocument(String)
Opens an existing PDF document.
Public methodPdfDocument(PdfConfigurationOptions)
Creates a new blank PDF document using specified configuration options.
Public methodPdfDocument(Byte[], String)
Opens an existing password-protected PDF document.
Public methodPdfDocument(Stream, PdfConfigurationOptions)
Opens an existing PDF document using specified configuration options.
Public methodPdfDocument(Stream, String)
Opens an existing password-protected PDF document.
Public methodPdfDocument(String, String)
Opens an existing password-protected PDF document.
Public methodPdfDocument(Stream, String, PdfConfigurationOptions)
Opens an existing password-protected PDF document using specified configuration options.

Properties

  NameDescription
Public propertyActionCount Obsolete.
Gets the number of actions added to this document.
Public propertyActions Obsolete.
Gets the collection of actions added to this document.
Public propertyAutoCreateUriActions
Gets or sets a value indicating whether to check each text string drawn with DrawString Overload or DrawText Overload for URIs and create PdfUriActions for each found URI.
Public propertyColorProfileCount Obsolete.
Gets the number of ICC color profiles added to this document.
Public propertyColorProfiles Obsolete.
Gets the collection of ICC color profiles added to this document.
Public propertyControlCount Obsolete.
Gets the number of controls in this document.
Public propertyControls Obsolete.
Gets the collection of controls in this document.
Public propertyEncryption
Gets or sets encryption algorithm for the current document.
Public propertyFontCount Obsolete.
Gets the number of fonts added to this document.
Public propertyFonts Obsolete.
Gets the collection of fonts added to this document.
Public propertyHasSignaturePermissions
Gets a value indicating whether this document has digital signature permissions.
Public propertyImageCount Obsolete.
Gets the number of images on this document.
Public propertyImages Obsolete.
Gets the collection of images on this document.
Public propertyInfo
Gets the interface for the document metadata.
Public propertyInitialView
Gets or sets the PdfDocumentView to open when the document is opened.
Public propertyIsLinearized
Gets a value indicating whether this document is linearized (optimized for fast viewing on the web).
Public propertyLayers
Gets the collection of layers (also known as optional content groups) in this document.
Public propertyMetadata
Gets the XMP metadata attached to the document.
Public propertyOnOpenDocument
Gets or sets the action to be performed when the document is opened.
Public propertyOutlineRoot
Gets the document outline root.
Public propertyOwnerPassword
Gets or sets the owner password for the document.
Public propertyPageCount
Gets the number of pages in this document.
Public propertyPageLabels
Gets the collection of page labeling ranges in this document.
Public propertyPageLayout
Gets or sets the page layout to be used when the document is opened by a PDF viewer application.
Public propertyPageMode
Gets or sets how the document should be displayed when opened by a PDF viewer application.
Public propertyPages
Gets the collection of pages in this document.
Public propertyPatternCount Obsolete.
Gets the number of patterns added to this document.
Public propertyPatterns Obsolete.
Gets the collection of patterns added to this document.
Public propertyPermissions
Gets the interface for the document access permissions.
Public propertySaveOptions
Gets the save settings (compression, optimizations and the like).
Public propertySharedAttachments
Gets the collection of document-level attachments.
Public propertySharedScripts
Gets the collection of shared JavaScript actions in this document.
Public propertyUserPassword
Gets or sets the user password for the document.
Public propertyVersion
Gets the version of the PDF specification to which the file conforms.
Public propertyViewCount Obsolete.
Gets the number of document views added to this document.
Public propertyViewerPreferences
Gets the interface for the viewer preferences of this document.
Public propertyViews Obsolete.
Gets the collection of document views added to this document.
Public propertyWidgetCount Obsolete.
Gets the number of widgets (annotations and controls) added to this document.
Public propertyWidgets Obsolete.
Gets the collection of widgets (annotations and controls) added to this document.

Methods

  NameDescription
Public methodAddColoredPattern
Adds the new colored tiling pattern to the end of the collection of document patterns.
Public methodAddColorProfile(Byte[])
Adds the new ICC color profile to the end of the collection of document color profiles.
Public methodAddColorProfile(Stream)
Adds the new ICC color profile read from specified stream to the end of the collection of document color profiles.
Public methodAddColorProfile(String)
Adds the new ICC color profile read from file with specified name to the end of the collection of document color profiles.
Public methodAddFont(Byte[])
Creates a new font using provided font bytes and adds the new font to the end of the collection of document fonts.
Public methodAddFont(Font)
Adds the new font with the properties of the specified Font to the end of the collection of document fonts.
Public methodAddFont(Stream)
Creates a new font using provided stream with font bytes and adds the new font to the end of the collection of document fonts.
Public methodAddFont(String)
Adds the new font with specified face name to the end of the collection of document fonts.
Public methodAddFont(PdfBuiltInFont)
Adds the new instance of built-in font to the end of the collection of document fonts.
Public methodAddFont(String, FontStyle)
Adds the new font with specified properties to the end of the collection of document fonts.
Public methodAddFont(Byte[], Boolean, Boolean)
Creates a new font with specified properties using provided font bytes and adds the new font to the end of the collection of document fonts.
Public methodAddFont(Stream, Boolean, Boolean)
Creates a new font with specified properties using provided stream with font bytes and adds the new font to the end of the collection of document fonts.
Public methodAddFont(PdfBuiltInFont, Boolean, Boolean)
Adds the new instance of built-in font with specified properties to the end of the collection of document fonts.
Public methodAddFont(Byte[], Boolean, Boolean, Boolean, Boolean)
Creates a new font with specified properties using provided font bytes and adds the new font to the end of the collection of document fonts.
Public methodAddFont(Stream, Boolean, Boolean, Boolean, Boolean)
Creates a new font with specified properties using provided stream with font bytes and adds the new font to the end of the collection of document fonts.
Public methodAddFont(String, Boolean, Boolean, Boolean, Boolean)
Adds the new font with specified properties to the end of the collection of document fonts.
Public methodAddFontFromFile(String)
Creates a new font using provided font file and adds the new font to the end of the collection of document fonts.
Public methodAddFontFromFile(String, Boolean, Boolean)
Creates a new font with specified properties using provided font file and adds the new font to the end of the collection of document fonts.
Public methodAddFontFromFile(String, Boolean, Boolean, Boolean, Boolean)
Creates a new font with specified properties using provided font file and adds the new font to the end of the collection of document fonts.
Public methodAddImage(Byte[])
Adds new image(s) with the data and properties read from the buffer with image bytes to the end of the collection of document images.
Public methodAddImage(Image)
Adds new image(s) with the data and properties of specified Image to the end of the collection of document images.
Public methodAddImage(Stream)
Adds new image(s) with the data and properties read from the specified stream to the end of the collection of document images.
Public methodAddImage(String)
Adds new image(s) with the data and properties read from the file with specified name to the end of the collection of document images.
Public methodAddImage(PdfImageFrame)
Creates a new image from specified PdfImageFrame and adds it to the end of the collection of document images.
Public methodAddImage(Byte[], PdfColor)
Creates image(s) with the data and properties read from the buffer with image bytes, applies specified mask color to them and adds resulting image(s) to the end of the collection of document images.
Public methodAddImage(Byte[], Byte[])
Creates a new image with the data and properties read from the buffer with image bytes, applies mask constructed from the buffer with mask image bytes to it and adds resulting image to the end of the collection of document images.
Public methodAddImage(Image, PdfColor)
Creates image(s) with the data and properties of specified Image, applies specified mask color to them and adds resulting image(s) to the end of the collection of document images.
Public methodAddImage(Image, Image)
Creates a new image with the data and properties of specified Image, applies mask constructed from specified Image to it and adds resulting image to the end of the collection of document images.
Public methodAddImage(Stream, PdfColor)
Creates image(s) with the data and properties read from the specified stream, applies specified mask color to them and adds resulting image(s) to the end of the collection of document images.
Public methodAddImage(Stream, Stream)
Creates a new image with the data and properties read from the specified stream, applies mask read from another stream to it and adds resulting image to the end of the collection of document images.
Public methodAddImage(String, PdfColor)
Creates image(s) with the data and properties read from the file with specified name, applies specified mask color to them and adds resulting image(s) to the end of the collection of document images.
Public methodAddImage(String, String)
Creates a new image with the data and properties read from the file with specified name, applies mask read from another file with specified name to it and adds resulting image to the end of the collection of document images.
Public methodAddPage
Adds new page to the end of the collection of document pages.
Public methodAddUncoloredPattern
Adds the new uncolored tiling pattern with specified underlying color space to the end of the collection of document patterns.
Public methodAppend(Byte[])
Appends the contents of specified buffer with PDF data to this PdfDocument.
Public methodAppend(Stream)
Appends the contents of specified stream with PDF data to this PdfDocument.
Public methodAppend(String)
Appends the contents of existing PDF file with the specified name to this PdfDocument.
Public methodAppend(Byte[], String)
Appends the contents of specified buffer with PDF data to this PdfDocument.
Public methodAppend(Stream, String)
Appends the contents of specified stream with PDF data to this PdfDocument.
Public methodAppend(String, String)
Appends the contents of existing PDF file with the specified name to this PdfDocument.
Public methodClear
Removes all document content and resets the document to the default state.
Public methodCopyPages(Int32[])
Copies pages with specified indexes into new PdfDocument.
Public methodCopyPages(PdfPage[])
Copies specified pages into new PdfDocument. This PdfDocument remains unchanged.
Public methodCopyPages(Int32, Int32)
Copies a range of pages into new PdfDocument. This PdfDocument remains unchanged.
Public methodCopyPages(Int32, Int32, PdfConfigurationOptions)
Copies a range of pages into new PdfDocument using specified configuration options. This PdfDocument remains unchanged.
Public methodCreateFileAttachment(String)
Creates attachment from the specified file and returns file specification for the attachment.
Public methodCreateFileAttachment(Byte[], String)
Creates attachment from provided bytes and returns file specification for the attachment.
Public methodCreateFileAttachment(Stream, String)
Creates attachment from contents of provided stream and returns file specification for the attachment.
Public methodCreateFileAttachment(String, String)
Creates attachment from the specified file and returns file specification for the attachment.
Public methodCreateFileAttachment(Byte[], String, String)
Creates attachment from provided bytes and returns file specification for the attachment.
Public methodCreateFileAttachment(Stream, String, String)
Creates attachment from contents of provided stream and returns file specification for the attachment.
Public methodCreateGoToPageAction(Int32, Double)
Creates the new PdfGoToAction with specified properties and adds it to the collection of document actions.
Public methodCreateGoToPageAction(PdfPage, Double)
Creates the new PdfGoToAction with specified properties and adds it to the collection of document actions.
Public methodCreateHideAction
Creates the new PdfHideAction and adds it to the collection of document actions.
Public methodCreateHyperlinkAction(String)
Creates the new PdfUriAction with specified uniform resource identifier (URI) to resolve and adds it to the collection of document actions.
Public methodCreateHyperlinkAction(Uri)
Creates the new PdfUriAction with specified uniform resource identifier (URI) to resolve and adds it to the collection of document actions.
Public methodCreateImportDataAction
Creates the new PdfImportDataAction and adds it to the collection of document actions.
Public methodCreateJavaScriptAction
Creates the new PdfJavaScriptAction with specified script contents and adds it to the collection of document actions.
Public methodCreateLayer(String)
Creates a new PdfLayer with specified name and adds it to the collection of documents layers.
Public methodCreateLayer(String, Boolean, PdfLayerIntent[])
Creates a new PdfLayer with specified name and properties and adds it to the collection of documents layers.
Public methodCreateRemoteGoToPageAction
Creates the new PdfRemoteGoToAction with specified properties and adds it to the collection of document actions.
Public methodCreateResetFormAction
Creates the new PdfResetFormAction and adds it to the collection of document actions.
Public methodCreateSubmitFormAction(Uri)
Creates the new PdfSubmitFormAction with specified properties and adds it to the collection of document actions.
Public methodCreateSubmitFormAction(Uri, Boolean)
Creates the new PdfSubmitFormAction with specified properties and adds it to the collection of document actions.
Public methodCreateSubmitFormAction(Uri, Boolean, PdfSubmitFormat)
Creates the new PdfSubmitFormAction with specified properties and adds it to the collection of document actions.
Public methodCreateView(Int32)
Creates the new PdfDocumentView for specified page and adds it to the collection of document views.
Public methodCreateView(PdfPage)
Creates the new PdfDocumentView for specified page and adds it to the collection of document views.
Public methodCreateXObject()
Creates a new XObject that can be used with one of the DrawXObject Overload methods.
Public methodCreateXObject(PdfPage)
Creates a new XObject using a page as template. The created XObject can be used with one of the DrawXObject Overload methods.
Public methodDispose
Frees and releases all resources allocated by this PdfDocument.
Public methodStatic memberDocumentsAreEqual(Byte[], Byte[], String)
Compares the data and structure of two PDF documents.
Public methodStatic memberDocumentsAreEqual(Stream, Stream, String)
Compares the data and structure of two PDF documents.
Public methodStatic memberDocumentsAreEqual(String, String, String)
Compares the data and structure of two PDF documents.
Public methodStatic memberDocumentsAreEqual(Stream, Stream, String, PdfConfigurationOptions)
Compares the data and structure of two PDF documents using specified configuration options.
Public methodEquals (Inherited from Object.)
Public methodExportFdf(Stream)
Takes the values from the controls in this PdfDocument and exports them into FDF document.
Public methodExportFdf(String)
Takes the values from the controls in this PdfDocument and exports them into FDF document.
Public methodExtractPages(Int32[])
Extracts pages with specified indexes into new PdfDocument.
Public methodExtractPages(PdfPage[])
Extracts specified pages into new PdfDocument.
Public methodExtractPages(Int32, Int32)
Extracts a range of pages into new PdfDocument.
Public methodExtractPages(Int32, Int32, PdfConfigurationOptions)
Extracts a range of pages into new PdfDocument using specified configuration options.
Public methodFlattenControls
Flattens all controls in the document. In effect, replaces controls with their appearance. Putting it differently, merges controls down on to their respective pages.
Public methodGetAction Obsolete.
Gets the action with the specified index.
Public methodGetActions
Returns the enumerator that iterates through the collection of actions in this document.
Public methodGetColorProfile Obsolete.
Gets the ICC color profile with the specified index.
Public methodGetColorProfiles
Returns the enumerator that iterates through the collection of color profiles in this document.
Public methodGetControl(Int32) Obsolete.
Gets the control with the specified index.
Public methodGetControl(String)
Gets the control by name.
Public methodGetControls
Returns the enumerator that iterates through the collection of document controls.
Public methodGetFont Obsolete.
Gets the font with the specified index.
Public methodGetFonts
Returns the enumerator that iterates through the collection of document fonts.
Public methodGetHashCode (Inherited from Object.)
Public methodGetImage Obsolete.
Gets the image with the specified index.
Public methodGetImages()
Returns the enumerator that iterates through the collection of document images including inline images and images added to document but not yet drawn on any canvas.
Public methodGetImages(Boolean)
Returns the enumerator that iterates through the collection of document images including or excluding the inline images. The enumerator includes images added to document but not yet drawn on any canvas.
Public methodGetPage
Gets the page with the specified index.
Public methodGetPattern Obsolete.
Gets the pattern with the specified index.
Public methodGetPatterns
Returns the enumerator that iterates through the collection of patterns in this document.
Public methodGetPdfaConformance
Gets PDF/A standard conformance level for this PdfDocument.
Public methodGetText()
Retrieves all text drawn on all pages of the document in plain text format.
Public methodGetText(PdfTextExtractionOptions)
Retrieves all text drawn on all pages of the document according to specified options.
Public methodGetTextWithFormatting
Retrieves all text drawn on all pages of the document formatted as seen in a PDF viewer.
Public methodGetType (Inherited from Object.)
Public methodGetView Obsolete.
Gets the document view with the specified index.
Public methodGetViews
Returns the enumerator that iterates through the collection of document views added to this document.
Public methodGetWidget Obsolete.
Gets the widget with the specified index.
Public methodGetWidgets
Returns the enumerator that iterates through the collection of document widgets (annotations and controls).
Public methodImportFdf(Byte[])
Takes the values from the FDF document and imports them into this PdfDocument.
Public methodImportFdf(Stream)
Takes the values from the FDF document and import them into this PdfDocument.
Public methodImportFdf(String)
Takes the values from the FDF document and imports them into this PdfDocument.
Public methodIndexOf
Gets the index of page in the document page collection.
Public methodInsertPage
Inserts new page into the collection of document pages at the specified index.
Public methodStatic memberIsPasswordProtected(Byte[])
Determines whether the PDF document is password protected.
Public methodStatic memberIsPasswordProtected(Stream)
Determines whether the PDF document is password protected.
Public methodStatic memberIsPasswordProtected(String)
Determines whether the PDF document is password protected.
Public methodStatic memberIsPasswordProtected(Stream, PdfConfigurationOptions)
Determines whether the PDF document is password protected using specified configuration options.
Public methodMovePage
Changes position of the page within the collection of document pages.
Public methodMovePages(Int32[], Int32)
Changes positions of all pages specified by their indexes within the collection of document pages.
Public methodMovePages(Int32, Int32, Int32)
Changes positions of all pages in specified range within the collection of document pages.
Public methodOpen(Byte[])
Replaces the contents of this PdfDocument with contents read from specified buffer with PDF data.
Public methodOpen(Stream)
Replaces the contents of this PdfDocument with contents read from specified stream with PDF data.
Public methodOpen(String)
Replaces the contents of this PdfDocument with contents of existing PDF file with the specified name.
Public methodOpen(Byte[], String)
Replaces the contents of this PdfDocument with contents read from specified buffer with PDF data.
Public methodOpen(Stream, String)
Replaces the contents of this PdfDocument with contents read from specified stream with PDF data.
Public methodOpen(String, String)
Replaces the contents of this PdfDocument with contents of existing PDF file with the specified name.
Public methodOpenImage(Byte[])
Opens the image and constructs a collection of its frames (pages).
Public methodOpenImage(Image)
Opens the image and constructs a collection of its frames (pages).
Public methodOpenImage(Stream)
Opens the image and constructs a collection of its frames (pages).
Public methodOpenImage(String)
Opens the image and constructs a collection of its frames (pages).
Public methodRemovePage(Int32)
Removes the page at the specified index of the collection of document pages.
Public methodRemovePage(PdfPage)
Removes the specified page from the collection of document pages.
Public methodRemovePages(Int32)
Removes a range of pages from the collection of document pages.
Public methodRemovePages(Int32[])
Removes pages with specified indexes from the collection of document pages.
Public methodRemovePages(PdfPage[])
Removes specified pages from the collection of document pages.
Public methodRemovePages(Int32, Int32)
Removes a range of pages from the collection of document pages.
Public methodRemoveSignaturePermissions
Removes all digital signature permissions from the PDF document.
Public methodRemoveStructureInformation
Removes all structure information from the PDF document.
Public methodRemoveTransparencyGroups
Removes all transparency groups from the PDF document.
Public methodRemoveWidget
Removes the specified widget from the document.
Public methodReplaceDuplicateFonts
Replaces all duplicate fonts with the first duplicate.
Public methodSave(Stream)
Saves the document to the specified stream.
Public methodSave(String)
Saves the document to the file with specified name.
Public methodSaveAsTiff(Stream, PdfDrawOptions)
Creates images of each page in the document, then creates a multipage TIFF from the images and saves the TIFF to the specified stream.
Public methodSaveAsTiff(String, PdfDrawOptions)
Creates images of each page in the document, then creates a multipage TIFF from the images and saves the TIFF to the file with specified name.
Public methodSetPdfAOutputIntent
Sets the PDF/A output intent for this document.
Public methodSetPdfXOutputIntent
Sets the PDF/X output intent for this document.
Public methodSwapPages
Interchanges positions of two pages.
Public methodToString (Inherited from Object.)

Events

  NameDescription
Public eventError
Occurs when the library detects an error in the PDF document structures and/or when the library can't process the PDF properly for some reason. It's a good idea to send all documents for which this event occurs to Bit Miracle.

See Also