Skip to main content
Participant
Jun 22, 2018 8:02 PM UTC
Answered

set properties of multiple annotations with Javascript Object

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 is closed to new replies. Start a new post to keep the conversation going.
kdownie88Correct answer
Participant
Jul 31, 2018 7:12 PM UTC

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

6 replies

Inspiring
Aug 1, 2018 3:57 PM UTC

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.

Translate
Thom Parker
Community Expert
Community Expert
Aug 1, 2018 5:03 PM UTC

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

Translate
Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Bernd Alheit
Community Expert
Community Expert
Jun 23, 2018 1:17 PM UTC

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

Translate
lrosenth
Adobe Employee
Adobe Employee
Jun 25, 2018 10:05 AM UTC

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

Translate
kdownie88AuthorCorrect answer
Participant
Jul 31, 2018 7:12 PM UTC

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

Translate