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

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

Community Beginner ,
Jan 02, 2019 Jan 02, 2019

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

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

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
Community Beginner ,
Jan 03, 2019 Jan 03, 2019

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

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 ,
Jan 03, 2019 Jan 03, 2019

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

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
Community Beginner ,
Jan 03, 2019 Jan 03, 2019

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) ?

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
Adobe Employee ,
Jan 03, 2019 Jan 03, 2019
LATEST

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

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
Community Beginner ,
Jan 03, 2019 Jan 03, 2019

Can you tell me how? An example would be appreciated

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