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

Javascript to execute Check Box tool in Adobe Acrobat Pro DC

Guest
Aug 29, 2016 Aug 29, 2016

Hi,

I want to draw check box by program in Adobe Acrobat DC.  app.listToolbarButtons() returns nothing.  I am unable to find the cName for check box tool.  If i am trying to call using execMenuItem that also not possible.  can any one help me on his.

Thanks

Ariv

TOPICS
Acrobat SDK and JavaScript
692
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 Expert ,
Aug 29, 2016 Aug 29, 2016

You should use the addField method of the Document object if you want to add a check-box field.

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
Guest
Aug 29, 2016 Aug 29, 2016

Hi,

I wanted to add the check box at the position where the mouse is in.  I wanted to execute the 'check box' tool through program.  if i have executed that check box tool then i can able to draw the check box. 

If you are suggesting any other method of drawing checkbox, that is also ok for me.

Thank you

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 Expert ,
Aug 29, 2016 Aug 29, 2016

That's possible, but it means you will have to execute the command using only the keyboard, which is a bit tricky (but not impossible)...

You can use the mouseX and mouseY properties of the Document object to get the current location of the mouse, in default user space in relation to the current page.

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 Expert ,
Aug 29, 2016 Aug 29, 2016

Just to clarify, I'm still talking about using addField. I don't think it can be done the way you've described.

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
Engaged ,
Aug 29, 2016 Aug 29, 2016

If you don't need the checkbox to be responsive to checks... meaning you just want a checked checkbox, not a checkbox field, you can use a stamp rather than addField.

If you want JavaScript to capture the mouse coordinates, you'll need to cover the entire page with a button field which may not be practical.

J-

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 Expert ,
Aug 29, 2016 Aug 29, 2016

If you want JavaScript to capture the mouse coordinates, you'll need to cover the entire page with a button field which may not be practical.

Not true. You can use the mouseX and mouseY properties, as I've mentioned.

Edit: Unless you mean that the button will also trigger the script itself, in which case you're correct. But it can still be done using the keyboard if the button is added to the application menus.

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
Guest
Aug 29, 2016 Aug 29, 2016
LATEST

Thank you very much.

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
Guest
Aug 29, 2016 Aug 29, 2016

Thank you very much.

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