Click or drag to resize
Pdf Library for .NET

PdfDocument Methods

The PdfDocument type exposes the following members.

Methods
 NameDescription
Public methodAddAssociatedFile(String, PdfAttachmentRelationship, String, String) Embeds a file from disk into the document as an associated file.
Public methodAddAssociatedFile(Stream, String, PdfAttachmentRelationship, String, String) Embeds the content of a stream into the document as an associated file.
Public methodAddBookmark(String, PdfDestination) Adds a new bookmark to the document outline. Shorthand for doc.Bookmarks.Add(text, destination).
Public methodAddBookmark(String, PdfDestination, PdfBookmark) Adds a new bookmark as a child of the specified parent bookmark. Shorthand for parent.ChildNodes.Add(text, destination).
Public methodAddFont(PdfStandardCJKFont) Adds one of the standard CJK pdf fonts to the pdf document.
Public methodAddFont(PdfStandardFont) Adds one of the standard pdf fonts to the pdf document.
Public methodAddFont(PdfSystemFont) Adds a system font to the pdf document. The font is always embedded.
Public methodAddFont(String) Adds a font loaded from a TrueType / OpenType file to the pdf document.
Public methodAddFont(PdfSystemFont, Boolean) Adds a system font to the pdf document.
Public methodCode exampleAddPage Adds a new page to the document. Shorthand for Add.
Public methodAddPage(PdfMargins) Adds a new page with the specified margins.
Public methodAddPage(PdfPage) Adds an existing PdfPage (for example, from another document) to this document.
Public methodAddPage(PdfCustomPageSize, PdfMargins) Adds a new page with the specified size and margins.
Public methodAddPage(PdfCustomPageSize, PdfMargins, PdfPageOrientation) Adds a new page with the specified size, margins, and orientation.
Public methodAddTemplate(RectangleF) Creates a template with the specified bounds and adds it to the pdf document.
Public methodAddTemplate(Single, Single) Creates a template with the specified dimensions and adds it to the pdf document.
Public methodCode exampleAppend(PdfDocument) Appends all pages from another PDF document to this document. The appended document must remain open until this document is saved.
Public methodAppend(Stream) Appends all pages from a PDF stream to this document.
Public methodAppend(String) Appends all pages from a PDF file to this document.
Public methodClose Closes the document and releases all resources.
Public methodClose(Boolean) Closes the document. When completely is true, all resources are released.
Public methodDetachStream Detaches the stream associated with the document.
Public methodStatic memberGetPagesCount(Stream) Gets the number of pages in a PDF document loaded from a stream.
Public methodStatic memberGetPagesCount(String) Gets the number of pages in a PDF file without fully loading the document.
Public methodInsertPage(Int32, PdfPage) Inserts an existing PdfPage at the specified index in this document.
Public methodInsertPage(Int32, PdfCustomPageSize, PdfMargins, PdfPageOrientation) Creates a new page and inserts it at the specified index with the given size, margins, and orientation.
Public methodRemovePage Removes the specified page from the document.
Public methodRemovePageAt Removes the page at the specified index.
Public methodSave Saves the PDF document and returns the content as a byte array.
Public methodSave(Stream) Saves the PDF document to a stream.
Public methodCode exampleSave(String) Saves the PDF document to a file.
Top
See Also