Merge multiple PDF into one using Programming language (.NET / VBScript)


  • Hi friends,

    Below is my detail explanation.

    Every Morning, we are getting multiple PDF files and our Executive needs to see in one PDF files.

    Right, now I am diong manually PDF Merge process using Acrobate Profetional. But Now, my client asking to convert this into automated process every morning.

    My question is , How can we Merge PDF processing using programming language .NET / Java Script and automate this every morning ?.

    (My client is not allowing to use any third paty tool for this process.)

    Can someone provide me a suggestions for this ?

    I am not a great programmer.

    So, if anyone provide me Coding Template / good URL, I will appreciate this.

    Let me know if you need more information.

    Thursday, June 24, 2010 1:46 AM

All replies

  • The class diagram editor cannot replace you as the programmer.

    Try for questions about automating Acrobat Professional.

    The following is signature, not part of post
    Please mark the post answered your question as the answer, and mark other helpful posts as helpful, so they will appear differently to other users who are visiting your thread for the same problem.
    Visual C++ MVP
    Thursday, June 24, 2010 5:12 PM
  • Hello,

    You may need this PDF lib to do so. Information about the vendor can be found at this blog .

    Thursday, July 15, 2010 3:12 AM
  • Hi

    You can merge pdf files by third party control in .net programming language. The below link is of PDFBOX Third party control. Just download it and use the wnvpdfmerge.dll to your application to use the classes and methods of it.


    To merge pdf file I am sending you Example that works fine in my app.

     public void PDFMerge(string filepath1, string filepath2)
          FileStream fs = new System.IO.FileStream(filepath1, System.IO.FileMode.Open, System.IO.FileAccess.Read);
          byte[] fpodoc = new byte[fs.Length];
          fs.Read(fpodoc, 0, (int)fs.Length);
          FileStream fs1 = new System.IO.FileStream(filepath2, System.IO.FileMode.Open, System.IO.FileAccess.Read);
          byte[] fileBytes = new byte[fs1.Length];
          fs1.Read(fileBytes, 0, (int)fs1.Length);
          MemoryStream file1 = new MemoryStream(fileBytes);
          MemoryStream file2 = new MemoryStream(fpodoc);
          PDFMerge pdfMerger = new PDFMerge();
          byte[] bytes = pdfMerger.RenderMergedPDFDocument();
          //Save the merged document in a file.
          System.IO.FileStream fileStream = null;
          string MergedFilePath = @"D:\Merged.pdf";
          fileStream = new System.IO.FileStream(MergedFilePath, System.IO.FileMode.Create, System.IO.FileAccess.ReadWrite, System.IO.FileShare.Read);
          fileStream.Write(bytes, 0, bytes.Length);

    If this solution solve your problem then mark it as answer.

    PDFBox is not a free software. But itextSharp(third party) doing same thing you can go for it also and its totally free. I had some issue with it so I preffred PDFBOX

    Friday, July 30, 2010 4:54 AM