Click or drag to resize
Pdf Library for .NET

PdfDocument Class

Represents a pdf document.
Inheritance Hierarchy
SystemObject
  SelectPdfPdfDocument

Namespace:  SelectPdf
Assembly:  Select.Pdf (in Select.Pdf.dll) Version: 24.1
Syntax
public class PdfDocument

The PdfDocument type exposes the following members.

Constructors
  NameDescription
Public methodPdfDocument
Creates an empty pdf document object.
Public methodPdfDocument(Stream)
Loads a pdf document from the specified stream.
Public methodPdfDocument(String)
Loads a pdf document from an existing pdf file.
Public methodPdfDocument(PdfStandard)
Creates an empty pdf document object.
Public methodPdfDocument(Stream, String)
Loads a pdf document from a stream containing a password protected pdf document.
Public methodPdfDocument(String, String)
Loads a pdf document from an existing password protected pdf file.
Top
Properties
  NameDescription
Public propertyBookmarks
Gets the bookmarks collection of the pdf document.
Public propertyCompressionLevel
Gets or sets the pdf document compression level.
Public propertyDocumentInformation
Gets a reference to the object that specifies the pdf document properties.
Public propertyFonts
Gets the pdf document fonts collection.
Public propertyFooter
Represents the default pdf document footer template.
Public propertyHeader
Represents the default pdf document header template.
Public propertyJpegCompressionEnabled
Gets or sets a flag indicating if the JPEG compression is enabled or not for the images in the generated pdf document.
Public propertyJpegCompressionLevel
Gets or sets the compression level of images in the generated pdf document.
Public propertyLFN
Internal use only.
Public propertyMargins
The default pdf document margins.
Public propertyOpenAction
The action to be performed when the pdf document is opened.
Public propertyPages
Gets the pdf document pages collection.
Public propertySecurity
Gets a reference to the object that specifies the pdf document security settings.
Public propertyTemplates
Gets the pdf document templates collection.
Public propertyViewerPreferences
Controls how the pdf document will appear in a pdf viewer (like Adobe Reader).
Top
Methods
  NameDescription
Public methodAddBookmark(String, PdfDestination)
Creates a root bookmark in the current pdf document.
Public methodAddBookmark(String, PdfDestination, PdfBookmark)
Creates a child bookmark in the current pdf document under the specified parent bookmark.
Public methodAddFont(Font)
Adds a system font to the pdf fonts collection.
Public methodAddFont(String)
Adds a system font to the pdf fonts collection. The font is loaded from the specified file.
Public methodAddFont(PdfStandardCJKFont)
Adds a standard CJK font to the pdf fonts collection.
Public methodAddFont(PdfStandardFont)
Adds a standard font to the pdf fonts collection.
Public methodAddFont(Font, Boolean)
Adds a system font to the pdf fonts collection.
Public methodAddPage
Creates a new pdf page and adds it to the pdf document pages collection.
Public methodAddPage(PdfMargins)
Creates a new pdf page with the specified margins and adds it to the pdf document pages collection.
Public methodAddPage(PdfPage)
Adds the specified page to the pdf document pages collection.
Public methodAddPage(PdfCustomPageSize, PdfMargins)
Creates a new pdf page with the specified size and margins and adds it to the pdf document pages collection.
Public methodAddPage(PdfCustomPageSize, PdfMargins, PdfPageOrientation)
Creates a new pdf page with the specified size, margins and orientation and adds it to the pdf document pages collection.
Public methodAddTemplate(RectangleF)
Adds a new template with the specified bounds to the pdf document templates collection.
Public methodAddTemplate(Single, Single)
Adds a new template with the specified width and height to the pdf document templates collection.
Public methodAppend
Appends all pages from another pdf document to the current pdf document.
Public methodClose
Closes the current pdf document.
Public methodDetachStream
Detaches the stream that was used to load the pdf document, leaving it open in case the current pdf document is closed.
Public methodStatic memberGetPagesCount(Stream)
Returns the number of pages in a specified pdf document.
Public methodStatic memberGetPagesCount(String)
Returns the number of pages in a specified pdf document.
Public methodInsertPage(Int32, PdfPage)
Inserts the specified page into the pdf document pages collection at the specified index.
Public methodInsertPage(Int32, PdfCustomPageSize, PdfMargins, PdfPageOrientation)
Creates a new pdf page with the specified size, margins and orientation and inserts it into the pdf document pages collection at the specified index.
Public methodRemovePage
Removes the specified page from the pdf document pages collection.
Public methodRemovePageAt
Removes the pdf page at the specified index in pdf document pages collection.
Public methodSave
Saves the pdf document as byte array.
Public methodSave(Stream)
Saves the pdf document to the specified stream.
Public methodSave(String)
Saves the pdf document to the specified file.
Top
Remarks
This class provides the API to create, load, modify and save a pdf document.
See Also