Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

intranet and PDFs

Status
Not open for further replies.

kienna

Technical User
May 15, 2003
16
CA
Hi,

I have a menu page that has buttons connecting to other pdfs. Everything works fine on the menu page in both reader and writer. However, when I go to post it on our intranet it does not work. The menu page does open, eventually, but none of the buttons work. In reader it does nothing, in writer, I get the following message in the console.

uncaught exception:Field Preview:Mouse Up:2: Invalid argument value for App.openDoc.

Is it possible that there is something wrong with my javascript, but if so, why does it work when I open the page through Adobe rather than the link?

 
Can you post a link to the problem document? Or list the JavaScript source in a message here?

I suspect the problem is with the pathname to your documents.

Thomas D. Greer
 
The following is the Javascript for the button.


var Name = this.getField ("ContractName");
var CS001previewDoc = app.openDoc ("CS001preview.pdf", this);
var Newname = CS001previewDoc.getField ("ContractName");
Newname.value = "Contract For " + Name.value;

This also has the user enter the name of the contract and then insert it at the top of that document.

Thank you for your help.
 
Right... you don't have any path to the document that a web browser could use. You need to use a URI (URL), not just a filename.

If for example all of your PDFs/contracts are stored centrally on the server, in a specific folder, so that that the address " could get to them, then you need to prepend that "web address" to your Name.value.

Thomas D. Greer
 
ok, I think I get it. However, I'm not quite sure how this is put into my script. This is what I think... but I'm almost positive that it is wrong.


var Name = this.getField ("ContractName");
var CS001previewDoc = app.openDoc (" this);
var Newname = CS001previewDoc.getField ("ContractName");
Newname.value = "Contract For " +
 
Actually, providing the documents are all in the same folder as the menu document, you shouldn't need to provide a path. Your code should be fine.

What you probably do need to do is add the following Document-level JavaScript to all the documents involved:

this.disclosed=true;

Try doing this with one of the documents and testing the relevant button on the browser and, if that works, do the same with the rest.

[In case you don't know, to set Document-Level JavaScript in Acrobat 5, you go to Tools>JavaScript>Document JavaScripts, type a name for your script in the top box (e.g. disclosed), click Add, delete the text that is there, type in the code listed above, click OK, click Close and then do a Save As.]
 
I already had that in the document javascript.

The funny thing is that if I open it through adobe reader or writer it works just fine. It isn't until I open it through the link on our intranet site that problems occur.

Thanks!
 
using the original code with getURL instead of app.openDoc works. However, now my CS001previewDoc apparently has no properties. I'm sure the disclosed line is in this file though.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top