Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

problem with MouseUp event with richValue in Acrobat

Community Beginner ,
Dec 26, 2022 Dec 26, 2022

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];
TOPICS
Acrobat SDK and JavaScript
486
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 26, 2022 Dec 26, 2022
LATEST

Hi,

That should work! But the event of the Mouse Up action runs while the on blur action for this field.

Did you allow the Multi-line and Rich Text properties of your field?

@+

Capture d’écran 2022-12-27 à 00.06.05.png

 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines