Skip to main content
Participant
September 21, 2021
Question

Script to create portfolio from multiple PDF files

  • September 21, 2021
  • 2 replies
  • 2798 views

Search didn't turn up anything current, so asking here. Is there a recommended method for automatically creating a PDF portfolio from several known PDF files.  I have a static PDF file and several reports that are generated every month. I'd like to somehow script combining these PDF files into a single new PDF portfolio every month.  It doesn't look like Distiller does that, and it doesn't look like Acrobat Pro's Action Wizard will do that either.  And I couldn't figure out how to control Acrobat with PowerShell or similar to feed it commands.  Any suggestions or pointers on how to proceed?

2 replies

Participant
September 23, 2021

After doing some additional research, it looks like this is probably not possible with Acrobat, in part due to Adobe's licensing restrictions on Acrobat. Specifically, Adobe doesn't permit automation of a licensed copy of Adobe Acrobat, except using Action Wizard, and automated tasks of Acrobat must be initiated by users. So that leaves probably writing a custom application that can be invoked as the final step of the report generation process to assemble the PDF Portfolio. Does anyone have experience using Datalogics' Adobe PDF Library product?  It seems like gross overkill for this one simple task!

 

Alternatively, if I set up the static PDF file so when a user opens it, are there enough capabilities in the JavaScript for Acrobat API to bring in several reports to a PDF Portfolio when a user opens the file? Going through the JavaScript for Acrobat API reference didn't make it clear if newCollection, followed by some addField calls, and then a saveAs will do the trick (I haven't programmed in a long time)

Thom Parker
Community Expert
Community Expert
September 24, 2021

A Portfolio is actually a fancy version of what's called a collection. You can create collections using Acrobat JavaScript. 

Here's the reference entry for the Collection object property of a pdf document:

https://opensource.adobe.com/dc-acrobat-sdk-docs/acrobatsdk/html2015/index.html#t=Acro12_MasterBook%2FJS_API_AcroJS%2FDoc_properties.htm%23TOC_collection1bc-6&rhtocid=_6_1_8_23_0_5

 

You use "app.newCollection()" to create a new PDF collection. 

 

 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
try67
Community Expert
Community Expert
September 22, 2021

Does it have to be a Portfolio? Why not a regular PDF file?

 

PS. If you found something that worked in the past there's a good chance it will work now too, maybe with some minor modifications.

Participant
September 22, 2021

Portfolio is a user requirement, because they've been doing it that way for many years.  They are currently assembling the PDF Portfolio manually using Acrobat Pro every month once the reports are generated, combining the static portion with the reports.  The legacy report writer engine is the old Oracle Forms and Reports, and for the time being is getting swapped for something that can be maintained, with the plan in the next year to move to a more modern low-code application development platform for the entire system.

 

The users have seen prototypes of PDF files with bookmarks as an alternative and didn't like it, because they couldn't easily export a single report from the big PDF file like they can with a PDF Portfolio, which is apparently a requirement