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?
Do you mean the Forms plugin included in the SDK of a custom plugin?
Copy link to clipboard
Copied
May be faster when you create a plug-in for this.
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.
Copy link to clipboard
Copied
Do you mean the Forms plugin included in the SDK of a custom plugin?
Copy link to clipboard
Copied
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.
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.
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