I'm in hell and need help.

Community Beginner ,
May 09, 2020 May 09, 2020

Copy link to clipboard

Copied

Designing a program to slim down paperwork.

Dynamically creating a form to select which paperwork to combine.

FROM FOLDER LEVEL SCRIPT:

function addGenerateButton()
{
var g = myDoc.addField("Generate", ....);
g.setAction("MouseUp", "myButtonAction();");
}

function myButtonAction()
{
....
}

How do I do this?  Should I do this? Is there a better way to do this?  

TOPICS
Acrobat SDK and JavaScript, General troubleshooting

Views

218

Likes

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
Community Beginner ,
May 09, 2020 May 09, 2020

Copy link to clipboard

Copied

Better question:

Is it possible to pass variables from a folder level script into a document level?

For example, I define string1 at folder level.

I need string1 to be available to a document level script.

 

Is this possible?

Likes

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
Community Beginner ,
May 09, 2020 May 09, 2020

Copy link to clipboard

Copied

Nevermind........

Likes

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
Most Valuable Participant ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

Yes, that is possible.

I don't see where you've defined myDoc in your code, though.

Likes

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
Community Beginner ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

It's a global earlier up in the folder script.

 

I guess my question boils down to, how do I make a button execute a custom function when pressed?  What's the easiest way to do this?

Likes

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
Most Valuable Participant ,
May 10, 2020 May 10, 2020

Copy link to clipboard

Copied

LATEST

The easiest, and only, way to do that is to call the function by its name, like this:

 

addGenerateButton();

Likes

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