Link Search Menu Expand Document

Merge All Documents Within Folder - C#

PDF Extractor SDK sample in C# demonstrating ‘Merge All Documents Within Folder’

Program.cs
using System.Diagnostics;
using Bytescout.PDFExtractor;

namespace MergeAllDocumentsWithinFolder
{
    class Program
    {
        static void Main(string[] args)
        {
            var SourceFolder = "PDFDocs";
            var DestinationFile = "result.pdf";
            var IncludeSubFolder = true;

            using (DocumentMerger merger = new DocumentMerger("demo", "demo"))
            {
                merger.MergeFolder(SourceFolder, DestinationFile, IncludeSubFolder);
            }

            // Open result document in default associated application (for demo purpose)
            ProcessStartInfo processStartInfo = new ProcessStartInfo(DestinationFile);
            processStartInfo.UseShellExecute = true;
            Process.Start(processStartInfo);
        }
    }
}

Download Source Code (.zip)

Return to the previous page Explore PDF Extractor SDK