set properties of multiple annotations with Javascript Object

New Here ,
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?

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

TOPICS
Acrobat SDK and JavaScript

Views

348

Likes

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

set properties of multiple annotations with Javascript Object

New Here ,
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?

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

TOPICS
Acrobat SDK and JavaScript

Views

349

Likes

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
Jun 22, 2018 0
Adobe Community Professional ,
Jun 23, 2018

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jun 23, 2018 1
Adobe Employee ,
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.

Likes

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
Reply
Loading...
Jun 25, 2018 1
New Here ,
Jul 31, 2018

Copy link to clipboard

Copied

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

Likes

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
Reply
Loading...
Jul 31, 2018 0
Adobe Community Professional ,
Aug 01, 2018

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.

Likes

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
Reply
Loading...
Aug 01, 2018 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Aug 01, 2018 0
Adobe Community Professional ,
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

Likes

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
Reply
Loading...
Aug 01, 2018 0