Sair
  • Comunidade global
    • Idioma:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

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

Explorador ,
Feb 21, 2023 Feb 21, 2023

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.

 

TÓPICOS
Criar PDFs
6.2K
Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Feb 22, 2023 Feb 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.
Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Feb 22, 2023 Feb 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!

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Feb 22, 2023 Feb 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

 

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

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

 

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

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.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Feb 22, 2023 Feb 22, 2023

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.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

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.

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Feb 22, 2023 Feb 22, 2023

Happy to jump!

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Feb 22, 2023 Feb 22, 2023

would be usefull to have a simple script example

can you point me in the right direction?

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Community Expert ,
Feb 22, 2023 Feb 22, 2023

Example for the output in the Javascript console:

console.println(this.path);
Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Feb 22, 2023 Feb 22, 2023

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?

 

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines
Explorador ,
Feb 22, 2023 Feb 22, 2023
MAIS RECENTE

File structure

 

Screenshot 2023-02-23 at 16.31.53.png

Traduzir
Denunciar
Diretrizes da comunidade
Seja respeitoso, dê crédito à fonte original do conteúdo e verifique se há cópias antes da publicação. Saiba mais
community guidelines