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

Calculations between PDFs in a Portfolio

Timmyb
Registered: Nov 19 2007
Posts: 25

Hi

Is it possible to set up calculations that work between different PDFs within the same portfolio? For example, you could have a number of PDFs acting as calculation sheets and one PDF acting as a summary sheet which totaled all the amounts from the other PDFs?

Thanks
Tim

thomp
Expert
Registered: Feb 15 2006
Posts: 4411
That would be a really nice feature. And believe me, you are not the first to ask about this. Actually, there was quite a bit of interest back when Collections (the fore-runner of Portfolios) were introduced in Acrobat 8.

The answer is yes and no. Adobe has made steps in the direction of adding this as a feature that users could actually use. But then they destroyed that with usage and security concerns about Portflios in Acrobat 9. It's a bummer, because it'd be nice to summarize form info in the Portfoloi Navigator(the main flash display). But there's no way for the Flash in the Navigator to communicate directly with the embedded files. I think this feature will eventually be added.

What you have to understand about Portfolios is that they are just a fancy UI on top of very ordinary embedded files. If you are a programmer you could setup your own interdocument calculations in almost exactly the same way it was done back in the old days.

So the answer is, there is no built-in support for this feature so it is not avialible to ordinary users. But if you are a programmer, then there is a way using JavaScript to setup some communication between files. Although it's not easy or a robust and clean solution.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Timmyb
Registered: Nov 19 2007
Posts: 25
Thanks for the reply. Pretty much as I expected. I have contacted our Account Manager at Adobe Europe to see if this development is being considered.

I myself am not a fully fledged programmer but some of my colleagues are. Can you [or anyone else] supply an example of the type of code that I would need to use to set this up. Or if you are unable to write an example are you able to describe what would need to be done?

Thanks
Tim
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
The main problem with communication between embedded files is that they, or code inside them, is unaware that it is in an embedded file. And it has no direct access to the parent file, i.e. the cover sheet. On the other hand, the Cover sheet has a listing of all the embedded files, called Data Objects. And it can open and access data in all the embedded files.

So the simplest approach is to drive all inter-document calculations from the Parent Document. This has the fewest programming difficulties. Unfortunately, for a Portfolio, the cover sheet is not normally visible and for casual users it's not easy to find, or to understand what they are looking at. So I would suggest that you use a regular PDF with embedded files for this and forget the portfolio.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

Timmyb
Registered: Nov 19 2007
Posts: 25
Thanks for your time on this.

Unfortunatly we already use embedded files within a single PDF. The problem is that this makes the document difficult to navigate. Which is why we were looking at the Portfolio as a solution. Having said that I presume it is possible to use LiveCycle to create a UI which then takes you to various embedded files; therefore improving the navigation?

Thanks
Tim
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Unfortunately, displaying an embedded file from navigation features on a coversheet is not so easy. This is about the only thing that the Portfolio Navigator does well. But there are a couple of options. First, you're better off using an AcroForm as the cover sheet since all the JavaScript code you'll need is native to this environment. Plus, you can add and maintian bookmarks much easier on an AcroForm than a LiveCycle doc.

So here are the two options:
1) Create a bookmark that opens the attached file, then from a button or link on the cover sheet JavaScript code can be used to run the link so you have at least two methods for navigating to the embedded file
2) In JavaScript, use the "doc.exportDataObject()" using the Launch option of 2. So you're not actually saving the PDF.

When accessing the attached LiveCycle forms from the AcroForm cover sheet to do data transfer you'll need to use code like this.

// Open an embedded form as a hidden file
var oXFADoc = this.openDataObject(this.dataObjects[0].name);

// Get a data value from the LiveCycle form
var nValue = oXFADoc.xfa.form.Form1.Page1.MySubForm.MyValue.rawValue;

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Then most important JavaScript Development tool in Acrobat
[url=http://www.pdfscripting.com/public/34.cfm#JSIntro][b]The Console Window (Video tutorial)[/b][/url]
[url=http://www.acrobatusers.com/tutorials/2006/javascript_console][b]The Console Window(article)[/b][/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script