You need to use the value returned by openDoc to get a reference to the Document object. However, unless you're running the code from the JS-Console or some other trusted context, this will require embedding a script in the file you're opening to "disclose" it. You can read about it in the documentation of openDoc.
Thanks for the response try67. I will be using the JS-Console in acrobat so that is not an issue. Just to clarify, instead of using this.addWatermarkFromFile I would use the object that is returned from the first function instead of "this"? Also, what is the proper syntax for that? Sorry if these are silly questions, I am not a pro at JS.
Correct. The syntax would be something like this (using your incomplete example above):
var doc = app.openDoc("filepath");
Thanks! That worked perfectly.