• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

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

Explorer ,
Feb 21, 2023 Feb 21, 2023

Copy link to clipboard

Copied

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.

 

TOPICS
Create PDFs

Views

3.8K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

  1. Use an Action to collect the paths of the PDF files
  2. Use a script to merge the collected paths to single PDFs.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

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

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

The Action will travers the source folder and the subfolders for you.

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

Be aware, though, that it will also convert any non-PDF files to PDF (if it can), so make sure your folder only contains PDFs before running it.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

OK. I am trying to create an Action. I am in the "Edit Action" window. I tried a few things... I don't get it. What would I do? Most fitting thing would be "Document Processing"... There is an element called Add Folder already present in the new Action. I choosen my Source Folder... Can not save this. I clearly don't understand how this should be done. Any help very much appreciated.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

Do you know how to write scripts for Acrobat using JS? Because if not, this is the least of your worries, as it's not a trivial scripting task.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

Happy to jump!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

would be usefull to have a simple script example

can you point me in the right direction?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

Example for the output in the Javascript console:

console.println(this.path);

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

Hello again. Not going anywhere fast here. So I am cycling through the "Source" folder and find all the files in all subfolders. The GUI only allows only for a merge (combine files) when choosing the files at the start. And that would be a manual action... 
Can you provide more hints?

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 22, 2023 Feb 22, 2023

Copy link to clipboard

Copied

LATEST

File structure

 

Screenshot 2023-02-23 at 16.31.53.png

 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines