Examples

How to Combine PDFs?

Combining PDFs together with DynamicPDF Merger is simple. Below are steps and sample code showing how to combine three PDF documents into one.

Steps to Combine PDF Files

  1. Create a Document object by passing the first PDF file.
  2. Call the AppendPdf method with the second PDF file.
  3. Repeat the call to the AppendPdf method any number of times depending on the number of PDFs you need to combine. Optionally you an also specify the pages from the PDF to be appended.
  4. Output the Document to the Browser.

Sample code - ASP

Dim MyDocument
Set MyDocument = Server.CreateObject("DynamicPDF.Document")
MyDocument.LoadPdf Server.MapPath("DocumentA.pdf")

MyDocument.AppendPdf Server.MapPath("DocumentB.pdf"), 1, 2
MyDocument.AppendPdf Server.MapPath("DocumentC.pdf")

MyDocument.DrawToWeb

Combine PDFs by Specifying Options

Steps to Combine PDFs

  1. Create a MergeOptions object.
  2. Set the options as per your requirement. In the example, we set FormFields to false, so form fields are not appended.
  3. Pass the MergeOptions object into the AppendPdf method.

Sample code - ASP

'Specify the options
Dim MgOptions
Set MgOptions = Server.CreateObject( "DynamicPDF.MergeOptions" )
MgOptions.MergeFormFields = False

MyDocument.AppendPdf "C:\DocumentC.pdf",  ,  ,  MgOptions

Getting Started

DynamicPDF Merger Information

More information can be found here:

Available in Other Platforms

DynamicPDF Merger PDF Library is available for .NET and Java platforms. Refer to the respective product pages for more details.

Why Choose DynamicPDF?

  • Transparent Pricing
  • Lots of Features
  • Easy to Use
  • Great Support
  • Efficient Performance
  • Product Maturity (Over 18 Years)
  • Free Evaluation
  • .NET Core Support (Most Products)
  • Flexible Licensing

We’re Not The Only Ones That Think We’re Great!