PDF Toolkit

Samples

Merge PDF

The PDFMerger class provides 3 different methods of merging PDF files:

  • Select and add individual PDF files to merge to a List
  • Merge all PDF files in a particular folder
  • Merge each folder in a folder tree separately

This Code sample requires the PDF Toolkit and is found in: C:\Aquaforest\PDF Toolkit\samples\MergePDFs


using Aquaforest.PDF;
using System.Collections.Generic;
    
namespace MergePDFs
{
    class Program
    {
        static void Main(string[] args)
        {
            PDFMerger merger = new PDFMerger();
    
            List pdfList = new List()
            {
                @"..\..\..\documents\source\image_pdf.pdf",
                @"..\..\..\documents\source\releasenotes.pdf",
                @"..\..\..\documents\source\pdf_with_images.pdf"
            };
    
            merger.MergePDFs(pdfList, @"..\..\..\documents\output\merge.pdf");
        }
    }
}