Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
Copy link to clipboard
Copied
var otherDoc = app.openDoc("/c/temp/myDoc.pdf");
otherDoc.getField("name").value="Enter your name here: "
otherDoc.getField("name").setFocus();
this.closeDoc();
this code doesnt work wen i hav changed it to suit my needs.(interms of the document name)
placed it in a catch block it returned otherDoc doesnt has no properties.
could you assist me please really need the help with this.
Copy link to clipboard
Copied
Do you have a file with that name in that location? Is it being opened?
Copy link to clipboard
Copied
Did you set property disclosed of the document?
Copy link to clipboard
Copied
Do I have to specify a full path? Can I have it link to a document located in the same folder as the document I'm creating the link in, as a relative reference? I just want navigation buttons that link to other PDF documents in the same folder. Eventually the PDFs will all be moved to another location on a server and accessed via the web. But I do not know the path of that location.
Copy link to clipboard
Copied
ok I actually figured out the syntax for opening a document in the same folder with no path. But it opens it in a new window. I would really like it to open in the same window as my original document, just like it would if I were to use the "open a file" command and select "existing window". The reason I'm not just doing that is because I have to create ALOT of PDFs with links to each other and when I copy a control between PDFs it doesn't bring over the actions for the control except for javascript. If I use javascript, its easy for me to just change one or two names of the file references rather than having to renavigate to all the files I'm linking when I start a new document.
This is my basic code to open a file:
app.openDoc("TemplateTest1.pdf", this);
Its placed on the mouse up event of a control. I thought the "this" part meant this window but I guess it doesn't since it opens the file in a new window.
The final version of this document will be accessed via internet explorer on a corporate intranet. when I open the document in internet explorer and execute the openDoc script, it opens the acrobat application as a new window while the original document remains in internet explorer. I want the new document, which is saved in the same location as the original, to replace the original document in internet explorer. I have done this before via bookmarks by assigning an open file action and specifying it to open in the existing window. I just dont know how to specify that instruction in javascipt.
Or if for some reason this isn't possible. Can I use the javascript to redirect internet explorer's address to the new document? If I do it this way I will need to get the address and then replace the exisiting file name with the new file name I want to link to. Is this possible. I'm interested in learning about both methods.
Sorry If Its rediculously basic. I am just learning javascript specifically for this PDF project.
Copy link to clipboard
Copied
Copy link to clipboard
Copied