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

Flattening All Currently Open PDFs using Action Wizard Java Script

New Here ,
May 17, 2024 May 17, 2024

Copy link to clipboard

Copied

Im trying to optimize my workload at my job. My company uses their own proprietary system to create documents for their clients. When the system creates these individual documents, they automatically get opened in Adobe Acrobat as individual PDFs without being saved anywhere on the computer. It is then my job to "flatten" each individual PDF, combine all printed PDFs into one single PDF (in a specific order) and then save it/send it to its final destination. I took it upon myself to attempt to speed up this process, I logged into my own personal Acrobat account and upgraded to PRO, instead of the companys standard account. I was able to use the Action Wizard to execute the JS command this.flattenPages(); as a short cut. This is a step in the right direction however I would like an Action Wizard JS command that flattens ALL open PDF tabs at once instead of clicking my newly created shortcut on each individual document.

Assuming this is posible I would then combine all flattened docs together into one PDF and then "Save As"

Can the Combination Process be automated too? If so can the docs be combined in a specific order instead of me manually adjusting them? Can this whole Process be automated up until the saving of the document?

 

Im not familiar with Adobe nor JS whatsover, so this is all new to me. Help would be appreciated 🙂

TOPICS
How to , JavaScript , Modern Acrobat , PDF

Views

516

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
Adobe Employee ,
May 17, 2024 May 17, 2024

Copy link to clipboard

Copied

Hi @rcarone 

Hope you are doing well and thanks for reaching out.

The workflow you are trying to achieve is might be possible using JavaScript. For more information please check the help pages listed below:
https://acrobatusers.com/tutorials/javascript_console/
https://helpx.adobe.com/acrobat/using/applying-actions-scripts-pdfs.html

Hope it will help

Regards
Amal

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 ,
May 20, 2024 May 20, 2024

Copy link to clipboard

Copied

I would be much easier to use an automation script for this purpose. 

 

Something like this, which you can run from the console  window.

 

app.activeDocs.forEach(oDoc=>oDoc.flattenPages());

 

This script could be expanded to combine all the files as well, but you'll need to have some way to identify the order. 

 

 

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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
New Here ,
May 28, 2024 May 28, 2024

Copy link to clipboard

Copied

LATEST

@Thom Parker Thank you, your script works perfectly for flattening all open my open PDFs. As far as the combining files, I will just have to manually re-organize the PDFs in proper order... as I lack the technical skills to write such a script, lol.

 

Thanks again 🙂

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