Skip to main content
Participant
Dec 12, 2018 9:51 PM UTC
Answered

After another pdf is opened, can not edit text fields

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

This topic is closed to new replies. Start a new post to keep the conversation going.
Test Screen NameCorrect answer
Legend
Dec 13, 2018 7:32 PM UTC

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!

3 replies

try67
Community Expert
Community Expert
Dec 12, 2018 9:53 PM UTC

The file has to be disclosed. You can do it by adding the following code as doc-level script:

this.disclosed = true;

Translate
Participant
Dec 13, 2018 7:25 PM UTC

Ah! Sorry, I should have mentioned that I already did that as such:

Translate
Test Screen NameCorrect answer
Legend
Dec 13, 2018 7:32 PM UTC

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!

Translate