Class PdfDocument
- Namespace
- BitMiracle.Docotic.Pdf
- Assembly
- BitMiracle.Docotic.Pdf.dll
Class for PDF document processing. This class can be used to create, read, merge or compare files in Portable Document Format.
public sealed class PdfDocument : IDisposable
- Inheritance
-
PdfDocument
- Implements
- Inherited Members
Remarks
The Docotic.Pdf Library Documentation page contains links to articles, guides, and sample code.
Constructors
- PdfDocument()
Creates a new blank PDF document.
- PdfDocument(PdfConfigurationOptions)
Creates a new blank PDF document using specified configuration options.
- PdfDocument(byte[])
Opens an existing PDF document.
- PdfDocument(Stream)
Opens an existing PDF document.
- PdfDocument(Stream, PdfConfigurationOptions)
Opens an existing PDF document using specified configuration options.
- PdfDocument(Stream, PdfDecryptionHandler)
Opens an existing encrypted PDF document.
- PdfDocument(Stream, PdfDecryptionHandler, PdfConfigurationOptions)
Opens an existing encrypted PDF document using specified configuration options.
- PdfDocument(string)
Opens an existing PDF document.
- PdfDocument(string, PdfConfigurationOptions)
Opens an existing PDF document using specified configuration options.
- PdfDocument(string, PdfDecryptionHandler)
Opens an existing encrypted PDF document.
- PdfDocument(string, PdfDecryptionHandler, PdfConfigurationOptions)
Opens an existing encrypted PDF document using specified configuration options.
Properties
- AssociatedFiles
(PDF 1.7) Gets the collection of files associated with this document.
- Collection
(PDF 1.7) Gets or sets the settings of the portable collection.
- GrantedPermissions
Gets the permissions granted for the current document.
- HasSignaturePermissions
Gets a value indicating whether this document has digital signature permissions.
- Info
Gets the interface for the document metadata.
- InitialView
Gets or sets the PdfDocumentView to open when the document is opened.
- IsLinearized
Gets a value indicating whether this document is linearized (optimized for fast viewing on the web).
- Layers
Gets the collection of layers (also known as optional content groups) in this document.
- Metadata
Gets the XMP metadata attached to the document.
- NeedAppearances
Gets or sets a value indicating whether the viewing application should construct appearances of all controls and widgets in this document.
- OnOpenDocument
Gets or sets the action to be performed when the document is opened.
- OutlineRoot
Gets the document outline root.
- PageCount
Gets the number of pages in this document.
- PageLabels
Gets the collection of page labeling ranges in this document.
- PageLayout
Gets or sets the page layout to be used when the document is opened by a PDF viewer application.
- PageMode
Gets or sets how the document should be displayed when opened by a PDF viewer application.
- Pages
Gets the collection of pages in this document.
- SharedAttachments
Gets the collection of document-level attachments.
- SharedScripts
Gets the collection of shared JavaScript actions in this document.
- SharedViews
Gets the collection of named destinations in this document.
- UsesObjectStreams
Gets a value indicating whether this document uses object streams to store internal structures more compactly.
- Version
Gets the version of the PDF specification to which this document conforms.
- ViewerPreferences
Gets the interface for the viewer preferences of this document.
- Xfa
Gets or sets the XFA form attached to the document.
Methods
- AddLtvInfo()
Adds long term validation (LTV) information to all signatures within this document.
- AddLtvInfo(PdfSignature[])
Adds long term validation (LTV) information to the specified signatures from this document.
- AddLtvInfo(PdfSigningOptions)
Adds long term validation (LTV) information for the certificates from the specified signing options.
- AddPage()
Adds new page to the end of the collection of document pages.
- Append(byte[])
Appends the contents of specified buffer with PDF data to this PdfDocument.
- Append(Stream)
Appends the contents of specified stream with PDF data to this PdfDocument.
- Append(Stream, PdfDecryptionHandler)
Appends the contents of the specified stream with PDF data to this PdfDocument.
- Append(Stream, PdfDecryptionHandler, PdfMergingOptions)
Appends the contents of the specified stream with PDF data to this PdfDocument.
- Append(string)
Appends the contents of existing PDF file with the specified name to this PdfDocument.
- Append(string, PdfDecryptionHandler)
Appends the contents of existing PDF file with the specified name to this PdfDocument.
- Append(string, PdfDecryptionHandler, PdfMergingOptions)
Appends the contents of an existing PDF file with the specified name to this PdfDocument.
- ContainsTransparencyGroups()
Checks if there are any objects with transparency groups in this document.
- CopyPages(PdfPage[])
Copies specified pages into new PdfDocument. This PdfDocument remains unchanged.
- CopyPages(int, int)
Copies a range of pages into new PdfDocument. This PdfDocument remains unchanged.
- CopyPages(int, int, PdfConfigurationOptions)
Copies a range of pages into new PdfDocument using specified configuration options. This PdfDocument remains unchanged.
- CopyPages(int[])
Copies pages with specified indexes into new PdfDocument.
- Create3dView(string)
Creates a 3D view object.
- CreateCollectionSettings()
(PDF 1.7) Creates collection settings to use in the Collection property.
- CreateColorProfile(byte[])
Creates a PDF color profile from the specified ICC color profile.
- CreateColorProfile(Stream)
Creates a PDF color profile from the specified ICC color profile stream.
- CreateColorProfile(string)
Creates a PDF color profile from the specified ICC color profile file.
- CreateColoredPattern(double, double)
Creates a new colored tiling pattern using the specified dimensions.
- CreateFileAttachment(byte[], string)
Creates attachment from provided bytes and returns file specification for the attachment.
- CreateFileAttachment(byte[], string, string?)
Creates attachment from provided bytes and returns file specification for the attachment.
- CreateFileAttachment(Stream, string)
Creates attachment from contents of provided stream and returns file specification for the attachment.
- CreateFileAttachment(Stream, string, string?)
Creates attachment from contents of provided stream and returns file specification for the attachment.
- CreateFileAttachment(string)
Creates attachment from the specified file and returns file specification for the attachment.
- CreateFileAttachment(string, string?)
Creates attachment from the specified file and returns file specification for the attachment.
- CreateFont(PdfBuiltInFont)
Creates a new instance of the built-in font with the specified name.
- CreateFont(byte[])
Creates a new font from the provided font data in byte array format.
- CreateFont(Stream)
Creates a new font from the provided stream containing font data.
- CreateFont(string)
Creates a new font with the specified font face name.
- CreateFont(string, bool, bool)
Creates a new font with the specified font face name, italic and bold properties.
- CreateFontFromFile(string)
Creates a new font from the specified font file.
- CreateGoToPageAction(PdfPage, double)
Creates a new PdfGoToAction with specified properties.
- CreateGoToPageAction(int, double)
Creates a new PdfGoToAction with specified properties.
- CreateGoToPageAction(string)
Creates a new PdfGoToAction associated with a named view (destination).
- CreateHideAction(bool)
Creates a new PdfHideAction.
- CreateHyperlinkAction(string)
Creates a new PdfUriAction with specified uniform resource identifier (URI) to resolve.
- CreateHyperlinkAction(Uri)
Creates a new PdfUriAction with specified uniform resource identifier (URI) to resolve.
- CreateImage(PdfImageFrame)
Creates a new image from the provided PdfImageFrame.
- CreateImage(byte[])
Creates a new image from the provided image data in byte array format.
- CreateImage(Stream)
Creates a new image from the provided stream containing image file data.
- CreateImage(string)
Creates a new image from the specified image file.
- CreateImportDataAction(string)
Creates a new PdfImportDataAction.
- CreateJavaScriptAction(string)
Creates a new PdfJavaScriptAction with specified script contents.
- CreateLaunchAction(string)
Creates a new PdfLaunchAction.
- CreateLayer(string)
Creates a new PdfLayer with specified name and adds it to the collection of documents layers.
- CreateLayer(string, bool, params PdfLayerIntent[])
Creates a new PdfLayer with specified name and properties and adds it to the collection of documents layers.
- CreateRemoteGoToPageAction(string, int)
Creates a new PdfRemoteGoToAction with specified properties.
- CreateRemoteGoToPageAction(string, string)
Creates a new PdfRemoteGoToAction associated with a named view (destination).
- CreateResetFormAction()
Creates a new PdfResetFormAction.
- CreateSubmitFormAction(Uri)
Creates a new PdfSubmitFormAction with specified properties.
- CreateSubmitFormAction(Uri, bool)
Creates a new PdfSubmitFormAction with specified properties.
- CreateSubmitFormAction(Uri, bool, PdfSubmitFormat)
Creates a new PdfSubmitFormAction with specified properties.
- CreateUncoloredPattern(double, double, PdfColorSpace)
Creates a new uncolored tiling pattern using the specified dimensions and color space.
- CreateView(PdfPage)
Creates a new PdfDocumentView for specified page and adds it to the collection of document views.
- CreateView(int)
Creates a new PdfDocumentView for specified page and adds it to the collection of document views.
- CreateXObject()
Creates a new XObject that can be used with one of the DrawXObject methods.
- CreateXObject(PdfPage)
Creates a new XObject using a page as template. The created XObject can be used with one of the DrawXObject methods.
- CreateXfaForm(Stream)
Creates an XFA form from the specified stream.
- CreateXfaForm(string)
Creates an XFA form from the specified stream.
- Dispose()
Frees and releases all resources allocated by this PdfDocument.
- DocumentsAreEqual(Stream, Stream)
Compares the data and structure of two not encrypted PDF documents.
- DocumentsAreEqual(Stream, Stream, PdfDecryptionHandler)
Compares the data and structure of two PDF documents.
- DocumentsAreEqual(Stream, Stream, PdfDecryptionHandler, PdfConfigurationOptions)
Compares the data and structure of two PDF documents.
- DocumentsAreEqual(string, string)
Compares the data and structure of two not encrypted PDF documents.
- DocumentsAreEqual(string, string, PdfDecryptionHandler)
Compares the data and structure of two PDF documents.
- ExportFdf(Stream)
Takes the values from the controls in this PdfDocument and exports them into FDF document.
- ExportFdf(string)
Takes the values from the controls in this PdfDocument and exports them into FDF document.
- ExtractPages(PdfPage[])
Extracts specified pages into new PdfDocument.
- ExtractPages(int, int)
Extracts a range of pages into new PdfDocument.
- ExtractPages(int, int, PdfConfigurationOptions)
Extracts a range of pages into new PdfDocument using specified configuration options.
- ExtractPages(int[])
Extracts pages with specified indexes into new PdfDocument.
- FlattenControls()
Flattens all controls in the document. In effect, replaces controls with their appearance. Putting it differently, merges controls down on to their respective pages.
- FlattenWidgets()
Flattens all widgets in the document. In effect, replaces widgets with their appearance. Putting it differently, merges widgets down on to their respective pages.
- GetActions()
Returns an enumerable collection of actions used in this document.
- GetColorProfiles()
Returns an enumerable collection of color profiles used in this document.
- GetControls()
Returns an enumerable collection of controls used in this document.
- GetEncryptionInfo(Stream)
Retrieves information about encryption scheme used in a PDF document.
- GetEncryptionInfo(Stream, PdfConfigurationOptions)
Retrieves information about encryption scheme used in a PDF document.
- GetEncryptionInfo(string)
Retrieves information about encryption scheme used in a PDF document.
- GetEncryptionInfo(string, PdfConfigurationOptions)
Retrieves information about encryption scheme used in a PDF document.
- GetFonts()
Returns an enumerable collection of fonts used in this document.
- GetImages()
Returns an enumerable collection of regular and inline images used in this document.
- GetImages(bool)
Returns an enumerable collection of images used in this document.
- GetPage(int)
Gets the page with the specified index.
- GetPatterns()
Returns an enumerable collection of patterns used in this document.
- GetPdfaConformance()
Gets PDF/A standard conformance level for this PdfDocument.
- GetPdfxConformance()
Gets PDF/X standard conformance level for this PdfDocument.
- GetText()
Retrieves all text drawn on all pages of the document in plain text format.
- GetText(PdfTextExtractionOptions)
Retrieves all text drawn on all pages of the document according to the specified options.
- GetTextWithFormatting()
Retrieves all text drawn on all pages of the document formatted as seen in a PDF viewer.
- GetViews()
Returns an enumerable collection of document views used in this document.
- GetWidgets()
Returns an enumerable collection of widgets (annotations and controls) used in this document.
- ImportFdf(byte[])
Takes the values from the FDF document and imports them into this PdfDocument.
- ImportFdf(Stream)
Takes the values from the FDF document and import them into this PdfDocument.
- ImportFdf(string)
Takes the values from the FDF document and imports them into this PdfDocument.
- IndexOf(PdfPage)
Gets the index of page in the document page collection.
- InsertPage(int)
Inserts new page into the collection of document pages at the specified index.
- MovePage(int, int)
Changes position of the page within the collection of document pages.
- MovePages(int, int, int)
Changes positions of all pages in specified range within the collection of document pages.
- MovePages(int[], int)
Changes positions of all pages specified by their indexes within the collection of document pages.
- OpenImage(byte[])
Opens the provided image data in byte array format and constructs a collection of its frames (pages).
- OpenImage(Stream)
Opens the provided stream containing image file data and constructs a collection of its frames (pages).
- OpenImage(string)
Opens the specified image file and constructs a collection of its frames (pages).
- RemovePage(PdfPage)
Removes the specified page from the collection of document pages.
- RemovePage(int)
Removes the page at the specified index of the collection of document pages.
- RemovePages(PdfPage[])
Removes specified pages from the collection of document pages.
- RemovePages(int)
Removes a range of pages from the collection of document pages.
- RemovePages(int, int)
Removes a range of pages from the collection of document pages.
- RemovePages(int[])
Removes pages with specified indexes from the collection of document pages.
- RemovePieceInfo()
Removes all page-piece dictionaries from the document.
- RemoveSignaturePermissions()
Removes all digital signature permissions from the PDF document.
- RemoveStructureInformation()
Removes all structure information from the PDF document.
- RemoveTransparencyGroups()
Removes all transparency groups from the PDF document.
- RemoveUnusedFontGlyphs()
Tries to remove unused glyphs from all fonts in the document.
- RemoveUnusedFontGlyphs(IEnumerable<PdfFont>)
Tries to remove unused glyphs from the specified fonts in the document.
- RemoveUnusedResources()
Removes references to resources such as fonts, xobjects, images, patterns.
- RemoveWidget(PdfWidget)
Removes the specified widget from the document.
- RemoveXfa()
Removes an XFA form attached to this document.
- ReplaceDuplicateObjects()
Replaces duplicate document objects with the first duplicate.
- ReplaceDuplicateObjects(PdfDuplicateObjectKinds)
Replaces duplicate document objects with the first duplicate.
- Save(Stream)
Saves the document to the specified stream.
- Save(Stream, PdfSaveOptions)
Saves the document using the specified save options to the specified stream.
- Save(string)
Saves the document to the file with the specified name.
- Save(string, PdfSaveOptions)
Saves the document using the specified save options to the file with the specified name.
- SaveAsTiff(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.
- SaveAsTiff(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.
- SetPdfAOutputIntent(PdfColorProfile)
Sets the PDF/A output intent for this document.
- SetPdfXOutputIntent(PdfColorProfile)
Sets the PDF/X output intent for this document.
- SignAndSave(PdfSigningOptions, Stream)
Digitally signs the document using the specified signing options. Then saves the document to the specified stream.
- SignAndSave(PdfSigningOptions, Stream, PdfSaveOptions)
Digitally signs the document using the specified signing and save options. Then saves the document to the specified stream.
- SignAndSave(PdfSigningOptions, string)
Digitally signs the document using the specified signing options. Then saves the document to the file with the specified name.
- SignAndSave(PdfSigningOptions, string, PdfSaveOptions)
Digitally signs the document using the specified signing and save options. Then saves the document to the file with the specified name.
- SwapPages(int, int)
Interchanges positions of two pages.
- SyncMetadata(bool)
Synchronizes values in XMP Metadata and Document Info.
- TimestampAndSave(PdfSignatureTimestampOptions, Stream)
Timestamps the document using the specified timestamp authority. Then saves the document to the specified stream.
- TimestampAndSave(PdfSignatureTimestampOptions, Stream, PdfSaveOptions)
Timestamps the document using the specified timestamp authority. Then saves the document to the specified stream.
- TimestampAndSave(PdfSignatureTimestampOptions, string)
Timestamps the document using the specified timestamp authority. Then saves the document to the file with the specified name.
- TimestampAndSave(PdfSignatureTimestampOptions, string, PdfSaveOptions)
Timestamps the document using the specified timestamp authority. Then saves the document to the file with the specified name.
- TryGetControl(string, out PdfControl?)
Attempts to retrieve a PdfControl by its name.