Skip to main content
Inspiring
February 22, 2023
Question

Batch Combine .pdf files inside many folders, per folder, into a combined .pdf

  • February 22, 2023
  • 1 reply
  • 6460 views

Hi all

I have many (approx. 100) folders with many (between 2 to 200) . pdf files inside.

I need the content of each folder to be merged (combine) into a single .pdf per folder.

Thought this should be easy (I write scripts for InDesign). So far... I have no idea how this works in Acrobat.

 

Extra difficulty: I work on MacOS, my client is on Windows.

I was hoping to create an Action that could be exported and imported at clients site.

 

I would appreciate any input. Thank you very much.

 

This topic has been closed for replies.

1 reply

Bernd Alheit
Community Expert
Community Expert
February 22, 2023
  1. Use an Action to collect the paths of the PDF files
  2. Use a script to merge the collected paths to single PDFs.
Inspiring
February 22, 2023

OK. This sounds good.

Step 1, the Action. How do I travers the content of the source folder, that is collect the many paths to the jobfolders?

I would usually have a loop within a loop. The inner loop collecting all the files and doing the merge. The outer loop traversing over all the jobfolders.

Maybe have more detailed advice. Thank you very much!

try67
Community Expert
Community Expert
February 22, 2023

That's what the Action does for you. You can't use a loop because you can't access the files in the folder using JS. You need to run the Action on the folder in question and then use the script to keep an in-memory copy of the path for each file. Then you use those paths to merge the files in a separate script.

That's basically what I did in this (paid-for) tool I've created that does just that:

https://www.try67.com/tool/acrobat-batch-combine-all-pdf-files-in-a-folder