Skip to main content
Participant
June 22, 2018
Answered

set properties of multiple annotations with Javascript Object

  • June 22, 2018
  • 2 replies
  • 1961 views

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?

This topic has been closed for replies.
Correct answer kdownie88

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

2 replies

Inspiring
August 1, 2018

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.

Thom Parker
Community Expert
Community Expert
August 1, 2018

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 PDFScriptingUse the Acrobat JavaScript Reference early and often
Bernd Alheit
Community Expert
Community Expert
June 23, 2018

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

lrosenth
Adobe Employee
Adobe Employee
June 25, 2018

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

kdownie88AuthorCorrect answer
Participant
July 31, 2018

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