Copy link to clipboard
Copied
Hello. I'm wondering why the richValue in the textbox doesn't work on the mouseUp event, while it does on the other mouse events. (the script placed in mouseUp behaves here as if it were placed in the onBlur event). I created a basicStyle object as a single item according to the MyStyle constructor. This object is part of the received spans array. Unable to declare:
event.target.richValue = [basicStyle];
(the code is placed on the mouseUp event) in the text field. And if I click in the box, nothing happens. The console says to me: "The setting is not possible, it is invalid or unknown." I am using Acrobat DC Pro 15.020.20039.7108
Thank you.
My javascript (in MouseUp event):
var MyStyle = function(
xText,
xTextColor,
xTextSize,
xLinespacing,
xFontFamily,
xFontWeight,
xFontStyle,
xAlignment,
xFontStretch,
xSubscript,
xSuperscript,
xUnderline
){
this.text = xText;
this.textColor = xTextColor;
this.textSize = xTextSize;
this.linespacing = xLinespacing;
this.fontFamily = xFontFamily;
this.fontWeight = xFontWeight;
this.fontStyle = xFontStyle;
this.alignment = xAlignment;
this.fontStretch = xFontStretch;
this.subscript = xSubscript;
this.superscript = xSuperscript;
this.underline = xUnderline;
};
var basicStyle = new MyStyle(
"Lorem ipsum, or lipsum as it is sometimes known, is dummy text used in laying out print, graphic or web designs.\nThe passage is attributed to an unknown typesetter in the 15th century who is thought to have scrambled parts of Cicero's De Finibus Bonorum et Malorum for use in a type specimen book. It usually begins with:",
["RGB", 203/255, 51/255, 151/255],//violet
18,
16,
["Calibri", "sans-serif"],
400,
"normal",
"justify",
"normal",
false,
false,
false
);
event.target.richValue = [basicStyle];
Copy link to clipboard
Copied
Find more inspiration, events, and resources on the new Adobe Community
Explore Now