Search code examples
batch-filepdfmergeacrobattableau-api

PDF Merge using cmd and Adobe Acrobat


My situatuion - I have a "process", in which Task Scheduler launches a Batch file which exports PDFs from Tableau with certain filters to a Folder. Each of these PDFs are different.

  • File1forPerson1.pdf
  • File2forPerson1.pdf
  • File3forPerson2.pdf
  • File4forPerson2.pdf

I would like to merge 2 PDFs into 1 file -eg:

  • File1forPerson1.pdf, File2forPerson1.pdf
  • File3forPerson2.pdf, File4forPerson2.pdf

Is it possible to do this without an external program? eg:

  • pdftk
  • iTextSharp

Would it be possible to automate this process using Task Scheduler or to use the initial batch file to start this process automatically. After the PDFs are merged they are sent via email using task scheduler. Is this something that could cause problems? Any help on this is very much appreciated, Thank You

Found some useful information and an excellent answer here: https://superuser.com/questions/389760/adobe-acrobat-how-to-batch-to-combine-multiple-pdf-files


Solution

  • You say "no external programs" but your title says "Adobe Acrobat" which is an external program.

    For the first part, no, Windows does not have any native PDF merging capabilities.

    For the second part, from the Adobe SDK FAQ:

    You can display and print a PDF file with Acrobat and Adobe Reader from the command line. These commands are unsupported, but have worked for some developers. There is no documentation for these commands other than what is listed below.

    And the commands show:

    /n Start a separate instance of Acrobat or Adobe Reader, even if one is currently open.
    /s Suppress the splash screen.
    /o Suppress the open file dialog box.
    /h Start Acrobat or Adobe Reader in a minimized window
    

    So no, Adobe Acrobat does not offer a command line option. You will need a third party