These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Use Acrobat 9 Pro portfolio info (Title,Author,Description,etc.) in 'child'/added pdf form

fixmedia
Registered: Nov 15 2010
Posts: 17

Two questions actually:
1) Is it possible by scripting (javascript), to use portfolio properties (meta)data in a pdf form which is added to the portfolio?
 
2) Is it possible by scripting (javascript), to use the folder name (folder which is added to the portfolio) in a pdf form which is added to this folder?
 
Workflow: a portfolio with the 'on a image' layout, user adds a folder, user adds a picture and a pdf form to this folder, user fills out the form, user extracts data in local database by ADBC.
 
A want to automate this database input by using the folder name and the 'parent' portfolio properties data.
 
OS: Windows 7
Acrobat version: Acrobat 9 Pro extended (don't use LiveCycle)
Local server: WampServer 2 (MySQL database)
 
A big thanks in advance!

My Product Information:
Acrobat Pro Extended 9.3.1, Windows
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
Question 1 is possible in theory, but requires code at the portfolio level - member documents cannot see their parent unless the parent explicitly declares itself.

Take a look at this link for an explanation of how to disclose the parent to the member documents (it refers to packages, but applies to portfolios as under the skin they're the same thing). Using the methods it describes it will be possible to return the portfolio's metadata object to a member document via a new app-level function.There's no way in JavaScript to find the folder name for a document, as "folders" in a portfolio are strictly a virtual concept. Because PDF file attachments cannot have tree structures, they're not part of the child document's path property, nor are they listed in the portfolio's dataObjects array. The "structure" is of course disclosed to the SWF navigator so it can draw the icons properly, but that's all.


Note that ADBC has been removed from the Acrobat X Family. You should convert to workflows that use XFA or SOAP.
fixmedia
Registered: Nov 15 2010
Posts: 17
@UVSAR: Thanks for the link, hope this will help in my solution. Do you have some more examples like these?
UVSAR
Expert
Registered: Oct 29 2008
Posts: 1357
There's a downloadable example on part 2 of that blog post - click here. Don't know of any others though.
fixmedia
Registered: Nov 15 2010
Posts: 17
@UVSAR: already found the examples in part 2 yesterday but I'm not a die-hard programmer so I'm trying to find some other examples which are a bit more understandable for me. I'll try some more testing today, thanks for now!
fixmedia
Registered: Nov 15 2010
Posts: 17
something went wrong, see next message
fixmedia
Registered: Nov 15 2010
Posts: 17
@UVSAR: I did some tests with openDataObject and stranded with some questions. Probably it's not possible what I'm trying to accomplish?

Tests so far with openDataObject:
- pdf portfolio with one child pdf,
- child pdf has a textfield called 'portfolio_title'
- code snippet from portfolio javascripts:

var dataObjecten = this.dataObjects;
console.println("---------------------------");
console.println("dataObject[0].name: "+dataObjecten[0].name);
try {
var oXFADoc = this.openDataObject(this.dataObjects[0].name);
app.alert("child pdf value: "+oXFADoc.getField("portfolio_title").value);
oXFADoc.getField("portfolio_title").value = docTitle;
app.alert(oXFADoc.getField("portfolio_title").value+" is the new portfolio_title value");
oXFADoc.closeDoc();
}
catch (e) {
app.alert("can't open: "+this.dataObjects[0].name);
}

Is it possible to populate textfield values in dataObjects? The thing is that my portfolio script can look in textfield values of dataObjects, populate with a new value but the new value is not 'saved' in the dataObject.

When I check the new value by opening the added/child pdf in the portfolio by hand, it still has the old (start) value. I tried to find some info about this but I'm searching in the wrong place I think.

In the end I still want to access/use the portfolio info in child/added pdf files. I did some tests (on my level of knowledge about this and what I can google) with the packages examples but I really don't get that.

Can you enlighten me some more about this problem? Thanks again in advance!