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

80

Likes

translate

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

Adobe Community Professional , 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 Field2this.getField("Field1").hidden = false;event.target.hidden = true;double click detection is outside the scope of this thread

Likes

translate

Translate

Translate
Adobe Community Professional ,
Dec 20, 2017 Dec 20, 2017

Copy link to clipboard

Copied

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

Likes

translate

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