Hi folks,
I'm trying to change pages in a second document using buttons in the first document.
The logistical bind, and the reason for the project, is that the second/target document is copyright and changes that require redistributing a modified version of it will violate the owner's copyright.
It is a PDF manual, distributed by a very large corporation, describing software used by tens of thousands of people. But BigCorp has amateurs doing the doc. The engineers pick it up after the product is released, so it comes out months later. The poor engineers don't have a clue about document design. The PDF does not have any bookmarks and there are no hotlinks anywhere. There are 887 pages and the first 20 of those are the TOC.
I would like to distribute an add-on document that would patch some of these problems. My first version, to test the concept and interest in the project, would be a 20 page document that corresponded to the table of contents. When you page through my doc, onPageOpen scripts would change pages in the second document. My document would have buttons labeled with the page numbers in the TOC so when you find the listing the target document's TOC, you click the page number button in my document and it changes the page in the target document.
The only way so far that I've been able to get any functions to work in the target document is to put them in a Folder-Based JavaScript file in Acrobat's JavaScripts directory. That script creates a submenu that has a separate command for each page change. I don't seem to be able to change pages directly from Document-Based functions, onPageChange or Button functions, but I can call the menu commands from those triggers.
By creating a menu command that lets the user set the target document to "disclosed", then buttons in my controlling document can call the menu functions inserted by the Folder-level script and change the page of the disclosed, target document.
So this requires about 650 buttons in my control document. I can automate generating those. But it also requires creating a Folder-Level Javascript that adds a submenu with over 650 menu entries in it.
Is this going to make Acrobat open absurdly slowly? Can Acrobat handle that many menu entries at all?
I could write a startup/cleanup OS commandline script that copies the JavaScript file into the Javascripts folder and removes it when done. That would avoid it getting in the way with other uses of Acrobat. But will it choke my project?
I could write a test that would add 100 or 650 menu items with all the same function code and see what it does.
But if someone else already knows what to expect, I would appreciate any advice.
And if anyone has any ideas for getting around the limits I've hit, like how to not HAVE TO add those menu commands in the first place to be able to execute a function on a second document, that would be really helpful.
Thanks for any comments,
August
You keep saying "changing pages". Do you really mean navigating to a page? So you want to add document navigation features? If this is the case, then there is absolutely no reason for a folder level script and menu items. You can do this all within the documents.
You can find gobs of information on scripts for navigating in a PDF here.
http://www.pdfscripting.com/public/department43.cfm
If you want to use a multidocument strategy for this, the both documents should have this line of code in a Document Level Script:
this.disclosed = true;
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]
Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script