Click or drag to resize

PdfDocument Class

A PDF Document
Inheritance Hierarchy
SystemObject
  IronPdfPdfDocument

Namespace:  IronPdf
Assembly:  IronPdf (in IronPdf.dll) Version: 4.4.6.19602 (4.4.6.1)
Syntax
public class PdfDocument

The PdfDocument type exposes the following members.

Constructors
  NameDescription
Public methodPdfDocument(Byte, String)
Opens an existing PDF document for editing.
Public methodPdfDocument(Stream, String)
Opens an existing PDF document for editing.
Public methodPdfDocument(String, String)
Opens an existing PDF document for editing.
Top
Properties
  NameDescription
Public propertyBinaryData
Gets the binary data for the full PDF file as a byte array;
Public propertyPageCount
Gets the number of pages in the PDF document.
Public propertyStream
Gets the binary data for the full PDF file as a Stream
Top
Methods
  NameDescription
Public methodAddBackgroundPdf(String, Int32)
Adds a background to each page of this PDF. The background is copied from a page in another PDF document.
Public methodAddBackgroundPdf(PdfDocument, Int32)
Adds a background to each page of this PDF. The background is copied from a page in another PDF document.
Public methodAddBackgroundPdfToPage(Int32, PdfDocument, Int32)
Adds the background to one page of this PDF. The background is copied from a page in another PDF document.
Public methodAddBackgroundPdfToPage(Int32, String, Int32)
Adds the background to one page of this PDF. The background is copied from a page in another PDF document.
Public methodAddBackgroundPdfToPageRange(IEnumerableInt32, PdfDocument, Int32)
Adds the background to specified pages of this PDF. The background is copied from a page in another PDF document.
Public methodAddBackgroundPdfToPageRange(IEnumerableInt32, String, Int32)
Adds the background to specified pages of this PDF. The background is copied from a page in another PDF document.
Public methodAddBackgroundPdfToPageRange(Int32, Int32, PdfDocument, Int32)
Adds the background to a range of pages in this PDF. The background is copied from a page in another PDF document.
Public methodAddBackgroundPdfToPageRange(Int32, Int32, String, Int32)
Adds the background to a range of pages in this PDF. The background is copied from a page in another PDF document.
Public methodAddFooters
Renders page footers to an existing PDF File
Public methodAddForegroundOverlayPdf(String, Int32)
Adds an overlay to each page of this PDF. The foreground overlay is copied from a page in another PDF document.
Public methodAddForegroundOverlayPdf(PdfDocument, Int32)
Adds an overlay to each page of this PDF. The foreground overlay is copied from a page in another PDF document.
Public methodAddForegroundOverlayPdfToPage(Int32, PdfDocument, Int32)
Adds an overlay to one page of this PDF. The foreground overlay is copied from a page in another PDF document.
Public methodAddForegroundOverlayPdfToPage(Int32, String, Int32)
Adds an overlay to one page of this PDF. The foreground overlay is copied from a page in another PDF document.
Public methodAddForegroundOverlayPdfToPageRange(IEnumerableInt32, PdfDocument, Int32)
Adds an overlay to a range page of this PDF. The foreground overlay is copied from a page in another PDF document.
Public methodAddForegroundOverlayPdfToPageRange(IEnumerableInt32, String, Int32)
Adds an overlay to a range page of this PDF. The foreground overlay is copied from a page in another PDF document.
Public methodAddForegroundOverlayPdfToPageRange(Int32, Int32, PdfDocument, Int32)
Adds an overlay to a range page of this PDF. The foreground overlay is copied from a page in another PDF document.
Public methodAddForegroundOverlayPdfToPageRange(Int32, Int32, String, Int32)
Adds an overlay to a range page of this PDF. The foreground overlay is copied from a page in another PDF document.
Public methodAddHeaders
Renders page headers to an existing PDF File
Public methodAddHTMLFooters
RendersHTML page footers to an existing PDF File
Public methodAddHTMLHeaders
Renders HTML page headers to an existing PDF File
Public methodAppendPdf
Appends another PDF to the end of the current PdfDocument
Public methodCopyPage
Creates a new PDF by copying a page from this PdfDocument.
Public methodCopyPages(IEnumerableInt32)
Creates a new PDF by copying a range of pages from this PdfDocument.
Public methodCopyPages(Int32, Int32)
Creates a new PDF by copying a range of pages from this PdfDocument.
Public methodEquals (Inherited from Object.)
Public methodExtractAllBitmaps
Finds all embedded Images from within the PDF and returns then as System.Drawing.Bitmap objects
Public methodExtractAllImages
Finds all embedded Images from within the PDF and returns then as System.Drawing.Image objects
Public methodExtractAllText
Extracts the written text content from the PDF and returns it as a string. (PDF OCR). Pages will be separated by 4 consecutive newline characters ("\n\n\n\n")
Public methodExtractBitmapsFromPage
Finds all embedded Images from within one page of the PDF and returns them as System.Drawing.Bitmap objects
Public methodExtractBitmapsFromPages(IEnumerableInt32)
Finds all embedded Images from within a specified pages in the PDF and returns them as System.Drawing.Bitmap objects
Public methodExtractBitmapsFromPages(Int32, Int32)
Finds all embedded Images from within a range of pages in the PDF and returns them as System.Drawing.Bitmap objects
Public methodExtractImagesFromPage
Finds all embedded Images from within one page of the PDF and returns them as System.Drawing.Image objects
Public methodExtractImagesFromPages(IEnumerableInt32)
Finds all embedded Images from within a specified pages in the PDF and returns them as System.Drawing.Image objects
Public methodExtractImagesFromPages(Int32, Int32)
Finds all embedded Images from within a range of pages in the PDF and returns them as System.Drawing.Bitmap objects
Public methodExtractTextFromPage
Extracts the text content from one page of the PDF and returns it as a string. (PDF OCR)
Public methodExtractTextFromPages(IEnumerableInt32)
Extracts the written text content from specified pages in the PDF PDF and returns it as a string. (PDF OCR). Pages will be separated by 4 consecutive newline characters ("\n\n\n\n")
Public methodExtractTextFromPages(Int32, Int32)
Extracts the written text content from a range of pages within the PDF and returns it as a string. (PDF OCR). Pages will be separated by 4 consecutive newline characters ("\n\n\n\n")
Public methodStatic memberFromFile
Opens an existing PDF document for editing.
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodInsertPdf
Inserts another PDF into of the current PdfDocument, starting at a given Page Index.
Public methodStatic memberMerge(IEnumerablePdfDocument)
Static method that joins (concatenates) multiple PDF documents together into one compiled PDF document.
Public methodStatic memberMerge(PdfDocument, PdfDocument)
Static method that joins (concatenates) 2 PDF documents together into one final PDF document.
Public methodPrependPdf
Adds another PDF to the beginning of the current PdfDocument
Public methodRemovePage
Removes a page from the PDF at the given index.
Public methodRemovePages(IEnumerableInt32)
Removes a range of pages from the PDF
Public methodRemovePages(Int32, Int32)
Removes a range of pages from the PDF
Public methodSaveAs
Saves the PdfDocument to a file.
Public methodStampHTML(HtmlStamp)
Edits the PDF by adding rendered HTML either behind or in-front of the existing contents of every page.
Public methodStampHTML(HtmlStamp, IEnumerableInt32)
Edits the PDF by adding rendered HTML either behind or in-front of the existing contents of specified pages.
Public methodStampHTML(HtmlStamp, Int32)
Edits the PDF by adding rendered HTML either behind or in-front of the existing contents of one page.
Public methodToString (Inherited from Object.)
Public methodTrySaveAs
Attempt to save the PdfDocument to a file.
Public methodWatermarkAllPages
Watermarks all pages of this PDF with HTML content.

Watermarks are restricted to basic positioning and a 100mm by 100mm maximum size. For more advanced options see StampHTML(HtmlStamp)

Public methodWatermarkPage
Watermarks a single page of this PDF with HTML content.

Watermarks are restricted to basic positioning and a 100mm by 100mm maximum size. For more advanced options see StampHTML(HtmlStamp, Int32)

Public methodWatermarkPages
Watermarks all pages of this PDF with HTML content.

Watermarks are restricted to basic positioning and a 100mm by 100mm maximum size. For more advanced options see StampHTML(HtmlStamp, IEnumerableInt32)

Top
Fields
  NameDescription
Public fieldPassword
Sets a Password used to protect and encrypt the PDF File. Setting a password will cause IronPDF to automatically protect the PDF file content using strong 128 bit encryption. Setting the password to null will remove any existing password.
Top
See Also