Review, Markup, and Approval
Using Commenting Tools
7
To set the language order, perform a similar algorithm using the
doc
object’s
spellLanguageOrder
property. An array of currently available dictionaries can be
obtained using the
spell
object’s
languages
property.
Adding Words to a Dictionary
You may use Acrobat JavaScript to add words to a dictionary by invoking the
spell
object’s
addWord
method, as shown in the code sample below:
spell.addWord(myDictionary, "myNewWord");
Adding Commenting Preferences
To use Acrobat JavaScript to set commenting preferences, create an object literal
containing common properties to be applied to your comments. Then for every
annotation, pass the object literal to its
annot
object’s
setProps
method, as shown in
the code sample below:
// Create the common properties in an object literal:
var myProps = {
strokeColor: color.red,
popupOpen: true,
arrowBegin: "Diamond",
arrowEnd: "OpenArrow"
};
// Assign the common properties to a previously created annot:
myAnnot.setProps(myProps);
Changing Colors, Icons, and Other Comment Properties
You may use Acrobat JavaScript to change the properties of any type of annotation. To
change the background color of a comment, assign a new value to its
fillColor
property. To change the icon, assign a value to its
attachIcon
,
noteIcon
, or
soundIcon
property. All the comment properties are available through the
annot
object, and may be set by invoking its
setProps
method.
Acrobat JavaScript Scripting Guide
133