Previous | Next | (P-PDF) JavaScript
Topic: gotoNamedDest in another document
Conf: (P-PDF) JavaScript, Msg: 66073
From: creheis
Date: 6/1/2002 07:50 AM
I'm new to JavaScript. I am wanting to open a new document with a button and go to a certain page or named destination. I also tried adding a bookmark in the new document to close the window. These work fine in Acrobat, but won't work in Reader. From what I could tell from the JavaScript Guide, the code I used should have been available in Reader. By using an older version of EScript.api I could get the gotoNamedDest part to work, but still not the Bookmark part. I assume I can't be supplying an older version of the ".api". Any suggestions appreciated.
My reason for using JavaScript is to control not closing my original document because I am using forms and want them to complete a quiz so that the form data is not lost, but I need them to be able to access other documents.
my code is below:
________________
otherDoc = app.openDoc("260Test.pdf");
otherDoc.gotoNamedDest("ancp3");
otherDoc.bookmarkRoot.createChild("RETURN TO EXAM", "this.closeDoc(bNoSave=true);");
var bm =otherDoc.bookmarkRoot.children[0];
otherDoc.bookmarkRoot.insertChild(bm, otherDoc.bookmarkRoot.children.length);
app."Use the 'RETURN TO EXAM' bookmark on the left to return.");