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

After another pdf is opened, can not edit text fields

New Here ,
Dec 12, 2018 Dec 12, 2018

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
374
Translate
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!

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

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

this.disclosed = true;

Translate
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

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

pdfhelp.png

Translate
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
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!

Translate
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