Can the Acrobat JSO list/create portfolio subfolders?

New Here ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

Within the Acrobat Pro view of a portfolio PDF file, I'm able to right click in the file and select "Create Folder" to create folder hierarchies for organizing portfolio attachments.

I'm using Acrobat PRO DC and Excel VBA to automate some interaction with these Portfolio PDF files.  Using the Adobe JSO, is there a way to get a list of existing portfolio subfolders? Or to create new folders?   

I'm able to add an attachment to a folder within a portfolio file using something like:

Call jso.importdataobject("<1>subfile.txt", "/F/Development/PermFile/subfile.txt")

This will import "subfile.txt" into the first existing folder within the JSO's portfolio file. However, this code does not work if a folder does not already exist in the portfolio file. So I'd like to be able to list existing folders in order to determine the correct folder index on the fly.  I'd also like to be able to create new folders/subfolders within the portfolio file.

Existing folders don't seem to be part of what's returned via the dataObjects collection, so I'm assuming the portfolio subfolders must be stored/modeled in some other fashion.

I've searched the SDK for information about portfolio/collection subfolders and couldn't find anything.  Any help would be greatly appreciated.  Thanks!

-Sam

TOPICS
Acrobat SDK and JavaScript

Views

559

Likes

translate

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

correct answers 1 Correct Answer

Adobe Community Professional , Feb 15, 2018 Feb 15, 2018
The question isn't if this can be done with the JSO, but can it be done with JavaScript?And the answer is No, there are no functions for creating collection folders.  However, the folders are only virtual, they don't have anything to do with how the files are organized internally. A file is associated with a folder by a number in angle brackets placed in front of the name. Ex:  "<1>MyFile.pdf".  this file is placed in the first folder.  Each folder has it's own indexYou can import files into a s...

Likes

translate

Translate

Translate
Adobe Community Professional ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

The question isn't if this can be done with the JSO, but can it be done with JavaScript?

And the answer is No, there are no functions for creating collection folders.  However, the folders are only virtual, they don't have anything to do with how the files are organized internally. A file is associated with a folder by a number in angle brackets placed in front of the name. Ex:  "<1>MyFile.pdf".  this file is placed in the first folder.  Each folder has it's own index

You can import files into a specific folder with code like this:

this.importDataObject("<1>MyFile");

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

Likes

translate

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 ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

I appreciate the response.  I had stumbled across the "importDataObject("<#>") piece.  It's disappointing to hear that there's no way to create a folder programmatically.

Do you know if there's a way to read out a listing of the existing folders from a file?  That way I could dynamically set the <#> index based on something like folder name?

Likes

translate

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 Community Professional ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

I don't think there is a way to do this either. There may be some undocument functions or properties, but I'm not aware of any JS functionality for getting this info.

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

Likes

translate

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 ,
Feb 15, 2018 Feb 15, 2018

Copy link to clipboard

Copied

There are C/C++ APIs for this, but not JavaScript.

Likes

translate

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 ,
Feb 23, 2018 Feb 23, 2018

Copy link to clipboard

Copied

Thank you both for the help!

Likes

translate

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