Examples

Merge PDF in COM/ActiveX

DynamicPDF makes Merging PDFs together easy. Here are some examples on the basic steps and how to specify what data is merged by using merge options.

How to Merge PDF Files

Below are the steps and sample code to merge PDF files with and without options.

Steps to Merge PDFs

  1. Create a Document object and Load the first PDF.
  2. Append the second PDF.
  3. 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")

MyDocument.DrawToWeb

If you have additional PDFs to merge, you can append them by calling the Append method.

Sample code with Append - ASP

Dim MyDocument
Set MyDocument = Server.CreateObject("DynamicPDF.Document")
MyDocument.LoadPdf Server.MapPath("doc-a.pdf")

MyDocument.AppendPdf Server.MapPath("doc-b.pdf"), 1, 2
MyDocument.AppendPdf Server.MapPath("doc-c.pdf")

MyDocument.DrawToWeb

Specifying The Type of Content to Be Merged

  1. If you would like to specify differant options, you can do so by creating the MergeOptions object.
  2. Modify the options as per requirement. In the example, the Outlines is set to false.
  3. Pass the MergeOptions object into the AppendPdf method.

Sample code for MergeOptions - ASP

Dim MgOptions
Set MgOptions = Server.CreateObject( "DynamicPDF.MergeOptions" )
MgOptions.Outlines = 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!