PdfDocument Methods

The PdfDocument type exposes the following members.

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(SimpleHeaderFooter, Boolean, IEnumerableInt32)
Renders page footers to an existing PDF File

Margin spacing on the PDF page for the footer are set to default values of 25mm. An overload method allow footer margins to be chosen specifically or set to zero.

Public methodAddFooters(SimpleHeaderFooter, Double, Double, Double, Boolean, IEnumerableInt32)
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(SimpleHeaderFooter, Boolean, IEnumerableInt32)
Renders page headers to an existing PDF File

Margin spacing on the PDF page for the header are set to default values of 25mm. An overload method allow header margins to be chosen specifically or set to zero.

Public methodAddHeaders(SimpleHeaderFooter, Double, Double, Double, Boolean, IEnumerableInt32)
Renders page headers to an existing PDF File
Public methodAddHeadersAndFooters
Renders page headers and footers to an existing PDF File
Public methodAddHTMLFooters(HtmlHeaderFooter, Boolean, IEnumerableInt32)
Renders HTML page footers to an existing PDF File

Margin spacing on the PDF page for the footer are set to default values of 25mm. An overload method allow footer margins to be chosen specifically or set to zero.

Public methodAddHTMLFooters(HtmlHeaderFooter, Double, Double, Double, Boolean, IEnumerableInt32)
Renders HTML page footers to an existing PDF File
Public methodAddHTMLHeaders(HtmlHeaderFooter, Boolean, IEnumerableInt32)
Renders HTML page headers to an existing PDF File

Margin spacing on the PDF page for the header are set to default values of 25mm. An overload method allow header margins to be chosen specifically or set to zero.

Public methodAddHTMLHeaders(HtmlHeaderFooter, Double, Double, Double, Boolean, IEnumerableInt32)
Renders HTML page headers to an existing PDF File
Public methodAddTextAnnotation(PdfDocumentTextAnnotation, Int32, Int32, Int32, Int32, Int32)
Adds an annotation to a page of this PdfDocument
Public methodAddTextAnnotation(String, String, String, Int32, Int32, Int32, Int32, Int32, PdfDocumentTextAnnotationAnnotationIcon, Boolean, Boolean, Boolean, String, Double)
Adds an annotation to a page of this PdfDocument
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 methodDispose
Releases used resources.
Public methodEquals
Determines whether the specified object is equal to the current object.
(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 methodExtractAllRawImages
Extracts all images from a PDf document. Images are Returned as their raw data in as Byte Arrays (byte[])
Public methodExtractAllText
Extracts the written text content from the PDF and returns it as a string.

Pages are be separated by 4 consecutive Environment.NewLines

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 methodExtractRawImagesFromPage
Finds all embedded Images from within one page of the PDF and returns them as raw image byte array objects
Public methodExtractRawImagesFromPages(IEnumerableInt32)
Finds all embedded Images from within a specified pages in the PDF and returns them as System.Drawing.Image objects
Public methodExtractRawImagesFromPages(Int32, Int32)
Finds all embedded Images from within a range of pages in the PDF and returns them as raw image byte array objects
Public methodExtractTextFromPage
Extracts the text content from one page of the PDF and returns it as a string.
Public methodExtractTextFromPages(IEnumerableInt32)
Extracts the written text content from specified pages in the PDF PDF and returns it as a string. Pages will be separated by 4 consecutive Environment.NewLines
Public methodExtractTextFromPages(Int32, Int32)
Extracts the written text content from a range of pages within the PDF and returns it as a string. Pages will be separated by 4 consecutive Environment.NewLines
Public methodFlatten
Flattens a document (make the fields non-editable).
Public methodStatic memberFromFile
Opens an existing PDF document for editing.
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetPageRotation
Gets the rotation of a PDF page in degrees.
Public methodGetPrintDocument
Returns a PrintDocument for the PDF allowing developers granular control over sending the PDF to a Printer.

An assembly reference to System.Drawing is required in your project.

Available in IronPDF for .Net Framework, and .Net Core. For Linux and OSX targets please install the Pdfium library to your application or bin directory for this functionality to work.

Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodGetVerifiedSignatures
Returns list of VerifiedSignature.
Public methodStatic memberGetVerifiedSignatures(Byte)
Returns list of VerifiedSignature from the specified Pdf document by the parameter data.
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 methodPageToBitmap(Int32, Int32)
Renders a single page of the PDF to a System.Drawing.Bitmap object.

Please add an assembly reference to System.Drawing to use this "PDF To Image" method

Please Dispose() each Bitmap object after use.

Public methodPageToBitmap(Int32, NullableInt32, NullableInt32, Int32)
Renders a single page of the PDF to a System.Drawing.Bitmap object.

Please add an assembly reference to System.Drawing to use this "PDF To Image" method

Please Dispose() each Bitmap object after use.

Public methodPrependPdf
Adds another PDF to the beginning of the current PdfDocument
Public methodPrint(Boolean)
Prints this PDF by sending it to the computer's printer.

For advanced real-world printing options please see overloads of this method and also GetPrintDocument.

if print preview dialogs will be displayed to the user. Default value is .
Public methodPrint(Int32, Boolean)
Prints this PDF by sending it to the computer's printer.

For advanced real-world printing options please see overloads of this method and also GetPrintDocument.

if print preview dialogs will be displayed to the user. Default value is .the horizontal and vertical PDF resolutions, in dots per inch. if -1 print with default printer resolution. Default value is -1.
Public methodPrint(String, Boolean)
Prints this PDF by sending it to the computer's printer.

For advanced real-world printing options please see overloads of this method and also GetPrintDocument.

the name of a printer, set or an empty string ("") to use default print. Default value is .if print preview dialogs will be displayed to the user. Default value is .
Public methodPrint(Int32, String, String, Boolean)
Prints this PDF by sending it to the computer's printer.

For even more advanced real-world printing options please see overloads of this method and also GetPrintDocument.

the horizontal and vertical PDF resolutions, in dots per inch. if -1 print with default printer resolution. Default value is -1.the name of a printer, set or an empty string ("") to use default print. Default value is .the file path, when printing to a file, set or an empty string ("") for printing output is sent to a port instead of the filePath. The default value is .if print preview dialogs will be displayed to the user. Default value is .
Public methodPrint(Int32, Int32, String, String, Boolean)
Prints this PDF by sending it to the computer's printer.

For advanced real-world printing options please see GetPrintDocument.

the horizontal PDF resolution, in dots per inch.the vertical PDF resolution, in dots per inch.the name of a printer, set or an empty string ("") to use default print. The default value is .the file path, when printing to a file, set or an empty string ("") for printing output is sent to a port instead of the filePath. The default value is .if print preview dialogs will be displayed to the user. The default value is .
Public methodPrintToFile(String, Boolean)
Prints this PDF by sending it to the computer's printer.

For advanced real-world printing options please see overloads GetPrintDocument.

the file path, when printing to a file, set or an empty string ("") for printing output is sent to a port instead of the filePath. The default value is .if print preview dialogs will be displayed to the user. Default value is .
Public methodPrintToFile(Int32, String, Boolean)
Prints this PDF by sending it to the computer's printer.

For advanced real-world printing options please see overloads of this method and also GetPrintDocument.

the horizontal and vertical PDF resolutions, in dots per inch. if -1 print with default printer resolution. Default value is -1.the file path, when printing to a file, set or an empty string ("") for printing output is sent to a port instead of the filePath. The default value is .if print preview dialogs will be displayed to the user. Default value is .
Public methodQuickSignPdfWithDigitalSignatureFile
Sign PDF with digital signature certificate. For more advanced Options please see QuickSignPdfWithDigitalSignatureFile(String, String)

Note that the PDF will not be fully signed until Saved using SaveAs(String), TrySaveAs(String), Stream or BinaryData. Multiple certificates may be used.

Not implemented in .Net Core

Public methodRasterizeToImageFiles(String, ImageType, Int32)
Renders the PDF and exports image Files in convenient formats. 1 image file is created for each page.

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodRasterizeToImageFiles(String, IEnumerableInt32, ImageType, Int32)
Renders the PDF and exports image Files in convenient formats. Page Numbers may be specified. 1 image file is created for each page.

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodRasterizeToImageFiles(String, NullableInt32, NullableInt32, ImageType, Int32)
Renders the PDF and exports image Files in convenient formats. Image dimensions may be specified. 1 image file is created for each page.

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodRasterizeToImageFiles(String, IEnumerableInt32, NullableInt32, NullableInt32, ImageType, Int32)
Renders the PDF and exports image Files in convenient formats. Page Numbers may be specified. 1 image file is created for each page.

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

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 methodRotateAllPages
Rotates all pages of the PdfDocument by a specified number of degrees.
Public methodRotatePage
Rotates one page of the PdfDocument by a specified number of degrees.
Public methodRotateSelectedPages
Rotates selected pages of the PdfDocument by a specified number of degrees.
Public methodSaveAs
Saves the PdfDocument to a file.

Supports site relative paths staring with "~/" in .Net Framework Web 4+ Applications

Public methodSignPdfWithDigitalSignature
Signs the PDF with digital signature with advanced options.

Note that the PDF will not be fully signed until Saved using SaveAs(String), TrySaveAs(String), Stream or BinaryData. Multiple certificates may be used.

Not implemented in .Net Core

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 methodToBitmap(Int32)
Rasterizes (renders) the PDF into System.Drawing.Bitmap objects. 1 Bitmap for each page.

Please add an assembly reference to System.Drawing to use this "PDF To Image" method.

Please Dispose() each Bitmap object after use.

Public methodToBitmap(IEnumerableInt32, Int32)
Rasterizes (renders) the PDF into System.Drawing.Bitmap objects.

Specific pages may be selected using the PageNumbers parameter.

Please add an assembly reference to System.Drawing to use this "PDF To Image" method

Please Dispose() each Bitmap object after use.

Public methodToBitmap(NullableInt32, NullableInt32, IEnumerableInt32, Int32)
Rasterizes (renders) the PDF into System.Drawing.Bitmap objects.

Specific pages may be selected using the PageNumbers parameter. The Widths and Height of the output images may be specified.

Please add an assembly reference to System.Drawing to use this "PDF To Image" method

Please Dispose() each Bitmap object after use.

Public methodToJpegImages(String, Int32)
Renders the pages of the PDF as JPEG files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToJpegImages(String, IEnumerableInt32, Int32)
Renders the pages of the PDF as JPEG files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToJpegImages(String, NullableInt32, NullableInt32, Int32)
Renders the pages of the PDF as JPEG files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToJpegImages(String, IEnumerableInt32, NullableInt32, NullableInt32, Int32)
Renders the pages of the PDF as JPEG files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToPngImages(String, Int32)
Renders the pages of the PDF as PNG (Portable Network Graphic) files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToPngImages(String, IEnumerableInt32, Int32)
Renders the pages of the PDF as PNG (Portable Network Graphic) files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToPngImages(String, NullableInt32, NullableInt32, Int32)
Renders the pages of the PDF as PNG (Portable Network Graphic) files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToPngImages(String, IEnumerableInt32, NullableInt32, NullableInt32, Int32)
Renders the pages of the PDF as PNG (Portable Network Graphic) files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Public methodToTiffImages(String, Int32)
Renders the pages of the PDF as TIFF (Tagged Image File Format / Tif) files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToTiffImages(String, IEnumerableInt32, Int32)
Renders the pages of the PDF as TIFF (Tagged Image File Format / Tif) files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToTiffImages(String, NullableInt32, NullableInt32, Int32)
Renders the pages of the PDF as TIFF (Tagged Image File Format / Tif) files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodToTiffImages(String, IEnumerableInt32, NullableInt32, NullableInt32, Int32)
Renders the pages of the PDF as TIFF (Tagged Image File Format / Tif) files and saves them to disk.

Specific image dimensions and page numbers may be given as optional parameters

FileNamePattern should normally contain an asterisk (*) character which will be substituted for the page numbers

Public methodTrySaveAs
Attempt to save the PdfDocument to a file.
Public methodVerifyPdfSignatures
Verifies all the PDF signatures for this PDF document and returns true if there are no invalid signatures.
Public methodStatic memberVerifyPdfSignaturesInFile
Verifies all the PDF signatures for a PDF file (by file path) and returns true if there are no invalid signatures.
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
See Also
Download DLL or Install with Nuget