How to click a button on PDF open using Acrobat SDK Javascript / Any other library

Community Beginner ,
Jan 02, 2019

Copy link to clipboard

Copied

Generate a pdf using acrobat sdk javascript which does the following things:

  • - It should contain a form with two input fields alpha and beta.
  • - The form has a submit button.
  • - I want to **submit** this form (click the submit button) **on document load** (trigger of the button) of the pdf **without** any prompts or user interaction.
  • - This should submit the form data to a remote url.

The biggest challenge I am facing is:

I am unable to find a way to click a button on load of the document without any user interaction

Action: Click a button

(Can't find the button in the doc let's say using button id or button name)

Trigger: On document load

Any help/ideas are appreciated, thanks!

TOPICS
Acrobat SDK and JavaScript

Views

458

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

How to click a button on PDF open using Acrobat SDK Javascript / Any other library

Community Beginner ,
Jan 02, 2019

Copy link to clipboard

Copied

Generate a pdf using acrobat sdk javascript which does the following things:

  • - It should contain a form with two input fields alpha and beta.
  • - The form has a submit button.
  • - I want to **submit** this form (click the submit button) **on document load** (trigger of the button) of the pdf **without** any prompts or user interaction.
  • - This should submit the form data to a remote url.

The biggest challenge I am facing is:

I am unable to find a way to click a button on load of the document without any user interaction

Action: Click a button

(Can't find the button in the doc let's say using button id or button name)

Trigger: On document load

Any help/ideas are appreciated, thanks!

TOPICS
Acrobat SDK and JavaScript

Views

459

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
Jan 02, 2019 0
Adobe Employee ,
Jan 02, 2019

Copy link to clipboard

Copied

You don’t need to click the button on document load – you can simply execute the Submit action on document load.

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
Reply
Loading...
Jan 02, 2019 0
Community Beginner ,
Jan 03, 2019

Copy link to clipboard

Copied

How to assign an action on document onload? I can't find the option to execute an action on document on load.

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
Reply
Loading...
Jan 03, 2019 0
Most Valuable Participant ,
Jan 03, 2019

Copy link to clipboard

Copied

Create document level JavaScript. That is executed on load. Mostly it defines functions, but code outside a function is executed at that time.

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
Reply
Loading...
Jan 03, 2019 0
Community Beginner ,
Jan 03, 2019

Copy link to clipboard

Copied

I have attempted to do this, it fails while opening in acrobat reader. If it's now too much trouble can you give an example (code snippet) ?

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
Reply
Loading...
Jan 03, 2019 1
lrosenth LATEST
Adobe Employee ,
Jan 03, 2019

Copy link to clipboard

Copied

A quick web search turned up a nice page about document level (document opening) scripting from our friends at PDFScripting.com

https://www.pdfscripting.com/public/Basic-Document-Level-Scripts.cfm

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
Reply
Loading...
Jan 03, 2019 0
Community Beginner ,
Jan 03, 2019

Copy link to clipboard

Copied

Can you tell me how? An example would be appreciated

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
Reply
Loading...
Jan 03, 2019 0