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

Script to create portfolio from multiple PDF files

New Here ,
Sep 21, 2021 Sep 21, 2021

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?

TOPICS
Create PDFs , Edit and convert PDFs , How to
2.2K
Translate
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 ,
Sep 22, 2021 Sep 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.

Translate
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 ,
Sep 22, 2021 Sep 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

Translate
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 ,
Sep 23, 2021 Sep 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)

Translate
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 ,
Sep 24, 2021 Sep 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%...

 

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

 

 

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

Translate
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 ,
Sep 24, 2021 Sep 24, 2021

Note that addField doesn't add files to the Portfolio, only "fields", which are not the same as form fields, either, but kind of Portfolio metadata.

Translate
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 ,
Sep 24, 2021 Sep 24, 2021

Thanks for clarifying that detail. Is there a way to add files to the PDF Portfolio (collection) in Javascript, whether individual PDF or other file types? The only methods I see for dealing with collections are addField, getField, and removeField. If addField doesn't add files to the collection, is there some other method I use for that? Or is it even possible to create and add files to a collection with Javascript in Acrobat?

Translate
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 ,
Sep 27, 2021 Sep 27, 2021
LATEST

The files in a Portfolio are PDF file attachments, which are called Data Objects in the JS model.  To add a files into the Portfolio you add data objects to the PDF.

 

  

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

Translate
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