Merger Plugin

Overview

The Aspose.Pdf.LowCode.Merger plugin combines multiple PDF documents into one output PDF. Configure the operation with MergeOptions, add each source document with AddInput, add the output target with AddOutput, and call Process.

Merge PDF documents

// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void MergePdfDocumentsWithPlugin()
{
    // The path to the documents directory
    var dataDir = RunExamples.GetDataDir_AsposePdf_Pages();

    // Create PDF Merger plugin
    var plugin = new Aspose.Pdf.LowCode.Merger();

    // Add input and output files
    var options = new Aspose.Pdf.LowCode.MergeOptions();
    options.AddInput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "Concat1.pdf"));
    options.AddInput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "Concat2.pdf"));
    options.AddOutput(new Aspose.Pdf.LowCode.FileDataSource(dataDir + "MergePdfDocuments_out.pdf"));

    // Merge the files
    var result = plugin.Process(options);

    // Get the path of the merged PDF document
    var outputPath = result.ResultCollection[0].ToFile();
}

Result

Process returns one file result for the merged document when a file output target is provided.