When I open a pdf it does not recognize the new document as a variable. The document opens up but in the debugger it shows oDoc as not being assigned. Once this PDF opens up it does not change the two fields because of this. What am I missing here?
var oDoc = app.openDoc(orgFilePath);
oDoc.getField("GTC_class_year").value = class_year;
oDoc.getField("GTC_class_number").value = class_number;
I am using the continuous version of DC 2019.008.20081
The file has to be disclosed. You can do it by adding the following code as doc-level script:
this.disclosed = true;
Ah! Sorry, I should have mentioned that I already did that as such:
That's just defined a function. You actually have to execute the assignment. Edit the script and remove the three wrapper lines which Acrobat makes for you, leaving just the "this.disclosed = true ;"
Also, some people mistakenly do this in the document where you run the script - no, don't!