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

Question about custom button triggers and actions.

New Here ,
Dec 20, 2017 Dec 20, 2017

Copy link to clipboard

Copied

I want a button to do this:

1) With single click on Field1 - hide Field1 and show Field2

2) With single click on Field2 - hide Field 2 and show Field1

3) With double click on Field1 - open a file

Basically, I want to show and hide images throughout a PDF. I want the option between having the image appear on the document and being able to open the image in a new window.

Any help? I very new to Javascript and cannot figure it out.

TOPICS
Acrobat SDK and JavaScript , Windows

Views

259

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

Community Expert , Dec 20, 2017 Dec 20, 2017

Hiding and showing fields is easy. But there is no double click event, so it has to be implemented as a script.

So here is code for the mouseUp on Field1:

this.getField("Field2").hidden = false;

event.target.hidden = true;

Here is the code for the mouseup on Field2

this.getField("Field1").hidden = false;

event.target.hidden = true;

double click detection is outside the scope of this thread

Votes

Translate

Translate
Community Expert ,
Dec 20, 2017 Dec 20, 2017

Copy link to clipboard

Copied

LATEST

Hiding and showing fields is easy. But there is no double click event, so it has to be implemented as a script.

So here is code for the mouseUp on Field1:

this.getField("Field2").hidden = false;

event.target.hidden = true;

Here is the code for the mouseup on Field2

this.getField("Field1").hidden = false;

event.target.hidden = true;

double click detection is outside the scope of this thread

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

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