Skip to main content
Participant
December 12, 2018
Answered

After another pdf is opened, can not edit text fields

  • December 12, 2018
  • 1 reply
  • 420 views

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 has been closed for replies.
Correct answer Test Screen Name

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!

1 reply

try67
Community Expert
Community Expert
December 12, 2018

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

this.disclosed = true;

Participant
December 13, 2018

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

Test Screen NameCorrect answer
Legend
December 13, 2018

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!