PdfMerge Class

The PdfMerge class provides functionality to merge multiple PDF files or streams into a single PDF document. It supports adding password protected PDFs, preserving bookmarks, annotations and internal links from the source files. Tagging and AcroForms are not preserved during the merge process

Definition

Namespace: HiQPdf.Next
Assembly: HiQPdf.Next (in HiQPdf.Next.dll) Version: 18.9.2
C#
public class PdfMerge : IDisposable
Inheritance
Object    PdfMerge
Implements
IDisposable

Constructors

PdfMerge The default constructor

Properties

DigitalSignature The digital signature to apply to generated PDF document
FlattenMergedPdf A flag indicating if the merged PDF is flattened. The default value is false
PdfMergeInfo This property provides details about the total number of pages produced and the number of pages from each merged document
Properties Controls the title, subject, keywords, author and the creation date of the PDF document
Security The object exposed by this property can be used to password protect the PDF document, disable printing, copying or editing of the PDF document
Viewer Controls the PDF viewer preferences

Methods

AddFileAttachment Adds a file to the document's attachments. The attachment appears in the Attachments panel of PDF viewers but has no visible icon on any page. To also display a clickable icon on a specific page, use AddFileAttachmentAnnotation(PdfFileAttachmentAnnotation)
AddFileAttachmentAnnotation Adds a file attachment displayed as a clickable icon on a specific page. Clicking the icon opens or extracts the attached file. The file is also added to the Attachments panel alongside any other attachments
AddHtmlTemplate(Int32, Int32, Int32, String) Creates a HTML Template object based on the HTML string and an optional base URL. The height of template is auto-resized. To create a template with fixed height use the method with height parameter
AddHtmlTemplate(Int32, Int32, Int32, Int32, String) Creates a HTML Template object based on URL from which the HTML content should be retrieved. The height of template is fixed. If AutoResizeHeight is true, the HTML content may be scaled down to fit the specified height
AddHtmlTemplate(Int32, Int32, Int32, String, String) Creates a HTML Template object to be rendered in PDF pages based on the HTML string and an optional base URL. The height of template is auto-resized. To create a template with fixed height use the method with height parameter
AddHtmlTemplate(Int32, Int32, Int32, PdfTemplateHorizontalAlign, PdfTemplateVerticalAlign, String) Creates a HTML Template object based on the HTML string and an optional base URL. Specifies the horizontal and the vertical alignment of the template on the PDF page. The alignment takes precedence over the X and Y coordinates when set to a value other than None. The height of template is auto-resized. To create a template with fixed height use the method with height parameter
AddHtmlTemplate(Int32, Int32, Int32, Int32, String, String) Creates a HTML Template object to be rendered in PDF pages based on the HTML string and an optional base URL. The height of template is fixed. If AutoResizeHeight is true, the HTML content may be scaled down to fit the specified height
AddHtmlTemplate(Int32, Int32, Int32, PdfTemplateHorizontalAlign, PdfTemplateVerticalAlign, String, String) Creates a HTML Template object to be rendered in PDF pages based on the HTML string and an optional base URL. Specifies the horizontal and the vertical alignment of the template on the PDF page. The alignment takes precedence over the X and Y coordinates when set to a value other than None. The height of template is auto-resized. To create a template with fixed height use the method with height parameter
AddHtmlTemplate(Int32, Int32, Int32, Int32, PdfTemplateHorizontalAlign, PdfTemplateVerticalAlign, String) Creates a HTML Template object based on URL from which the HTML content should be retrieved. Specifies the horizontal and the vertical alignment of the template on the PDF page. The alignment takes precedence over the X and Y coordinates when set to a value other than None. The height of template is fixed. If AutoResizeHeight is true, the HTML content may be scaled down to fit the specified height
AddHtmlTemplate(Int32, Int32, Int32, Int32, PdfTemplateHorizontalAlign, PdfTemplateVerticalAlign, String, String) Creates a HTML Template object to be rendered in PDF pages based on the HTML string and an optional base URL. Specifies the horizontal and the vertical alignment of the template on the PDF page. The alignment takes precedence over the X and Y coordinates when set to a value other than None. The height of template is fixed. If AutoResizeHeight is true, the HTML content may be scaled down to fit the specified height.
AddLinkAnnotation Adds a clickable hyperlink annotation placed on a specific page. The link can target an external URL, another page in the same document, a specific location on another page, or a named destination defined in the document catalog. Use one of the static factory methods on PdfLinkAnnotation (FromUrl, ToPage, ToPageLocation, ToNamedDestination) to build the link
AddPdf(Byte, String) Adds a PDF from a memory buffer
AddPdf(String, String) Adds a PDF from a file
AddTextAnnotation Adds a sticky-note text annotation displayed as a clickable icon on a specific page. Clicking the icon opens a popup with the note text. The annotation also appears in the viewer's Comments panel
Dispose Releases all resources used by this instance
Dispose(Boolean) Performs the actual resource cleanup
Equals
(Inherited from Object)
Finalize
(Inherited from Object)
GetHashCode
(Inherited from Object)
GetType
(Inherited from Object)
MemberwiseClone
(Inherited from Object)
Save Merges the PDFs and saves the result to a memory buffer
SaveAsync Asynchronously merges the PDFs and saves the result to a memory buffer
SaveToFile Merges the PDFs and saves the result to a file
SaveToFileAsync Asynchronously merges the PDFs and saves the result to a file
ToString
(Inherited from Object)

See Also