• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

After another pdf is opened, can not edit text fields

New Here ,
Dec 12, 2018 Dec 12, 2018

Copy link to clipboard

Copied

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

TOPICS
Acrobat SDK and JavaScript , Windows

Views

188

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Dec 13, 2018 Dec 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!

Votes

Translate

Translate
Community Expert ,
Dec 12, 2018 Dec 12, 2018

Copy link to clipboard

Copied

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

this.disclosed = true;

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

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

pdfhelp.png

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 13, 2018 Dec 13, 2018

Copy link to clipboard

Copied

LATEST

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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines