getAnnots() returns null in script
This one completely baffles me. When run inside the console, it works. When called from a framing script, it does not.
I have a pdf document that contains a stamp. I wish to "get" that stamp so I can clone it into a different document. But here's where I run into a problem: Getting the annotations from the Javascript Console inside Acrobat DC...:
var refDoc = app.openDoc("/ArtDept/ArtDept/JOBS/462000-462999/462000/CS/493130_T-N10-WHITE_CartoonNetwork_SPEC.pdf");
console.println("refDoc is: " + refDoc);
console.println("refDoc's name is: " + refDoc.documentFileName);
var refAnnots = refDoc.getAnnots();
console.println("refAnnots: " + refAnnots);
works fine. `refAnnots` shows me a list of all the annotations (stamps included) in the document.
If I run the *exact same code* inside of a much larger script, `refAnnots` is null. Meaning that the script couldn't find any annotations in the document.
I've already made sure that the code sits inside of `app.beginPriv();` and `app.endPriv();` lines as well as being inside a function that is defined inside of `app.trustedFunction()`. All of this is in a file that is in the application-level folder. Thus, security should not be an issue. Everything else inside this function works perfectly.
