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

set properties of multiple annotations with Javascript Object

New Here ,
Jun 22, 2018 Jun 22, 2018

Copy link to clipboard

Copied

I'm using the Javascript object interface to set properties of multiple annotations on a page. I would like the set the properties of all selected annotations at once but this method only allows setting the properties of one annotation at time, forcing me to iterate through all selected annotations and set them one at a time.  The is very slow.  In Acrobat DC user interface I can select multiple annotations and set all their properties at once (very quick).  Is there any programmatic means to accomplish this?

TOPICS
Acrobat SDK and JavaScript

Views

1.1K

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

New Here , Jul 31, 2018 Jul 31, 2018

Do you mean the Forms plugin included in the SDK of a custom plugin?

Votes

Translate

Translate
Community Expert ,
Jun 23, 2018 Jun 23, 2018

Copy link to clipboard

Copied

May be faster when you create a plug-in for this.

Votes

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
Adobe Employee ,
Jun 25, 2018 Jun 25, 2018

Copy link to clipboard

Copied

Doing this from a plugin will be MUCH faster and more efficient. The JS interface wasn’t designed for this.

Votes

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
New Here ,
Jul 31, 2018 Jul 31, 2018

Copy link to clipboard

Copied

Do you mean the Forms plugin included in the SDK of a custom plugin?

Votes

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 Expert ,
Aug 01, 2018 Aug 01, 2018

Copy link to clipboard

Copied

LATEST

And the answer is NO, the forms plug-in is for handling form field data and properties, and you said you wanted to change annotation properties.  In the JS world Annotation means a markup or drawing annotation. In a plug-in this has to be done with either the PDAnnot object methods, or through raw COS object properties.

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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
LEGEND ,
Aug 01, 2018 Aug 01, 2018

Copy link to clipboard

Copied

When you say it's very slow, I'm curious to know how many annotations you're dealing with at a time, what properties you're setting, and how long it takes. There may be things you can do to speed things up, maybe significantly, depending on what you're doing. When using the JavaScript interface, it's often faster to implement most of the code in folder-level JavaScript routines and call them via the interface.

Votes

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 Expert ,
Aug 01, 2018 Aug 01, 2018

Copy link to clipboard

Copied

Annotations have the nasty property of trying to redraw themselves if any property changes.  This has always made updating annotations slow.  So one option to speed up the script is to turn off redrawing with the "annot.delay" property. Set this first before making any updates. Then reset after all annot changes have been made. However, it won't ever be as fast as using a plug-in

Thom Parker - Software Developer at PDFScripting
Use the Acrobat JavaScript Reference early and often

Votes

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