Changing Color of Text | Community
Skip to main content
Level 3
November 1, 2011
Solved

Changing Color of Text

  • November 1, 2011
  • 6 replies
  • 5774 views

I'm looking for a way to change color of the font when a certain person reviews the document.  After the document has been signed then the reviewer goes in to make the changes.  Is there a way for when the reviewer types in the changes the text color is different??

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by

The attached contains examples of changing text field properties through script. For example, to change font colour.

// form1.page1.subform1.cb4::change - (JavaScript, client)

if (this.rawValue == 1) {

          xfa.resolveNode("form1.page1.subform1.tf.font.fill.color").value = "255,255,0";

}

else {

          xfa.resolveNode("form1.page1.subform1.tf.font.fill.color").value = "0,0,0";

}

Steve

6 replies

Srini_Dhulipall
Level 10
November 1, 2011

You can change the font color dynamically by using the syntax below..

FieldName.font.fill.color.value = "0,0,255"; //(Provide the RGB numbers).

Thanks

Srini

Level 3
November 1, 2011

But is there a way to assign that color to a certain user?

Srini_Dhulipall
Level 10
November 1, 2011

You can. But the PDF should know who the user is when the form is opened.

For example, if you are using a server side rendering, you can pass the logged in user info in the data file before rendering.

If you are not using the Server side rendering, then you can assign a value to a hidden field when the form is submitted to a reviewer. In the initialize event of the field, you can check the the hidden field value and if it matches to reviewer, then you can change the font color.

If you want to do the second approach, the you need to make sure you set the "Preserve scripting changes to form when saved" to Automatically in the File menu -> Form Properties and in the Default tab.

Thanks

Srini

Level 3
November 2, 2011

Can you maybe post an example script.  I'm still somewhat new with all this LiveCycle scripting stuff.  Thanks.

Accepted solution
November 2, 2011

The attached contains examples of changing text field properties through script. For example, to change font colour.

// form1.page1.subform1.cb4::change - (JavaScript, client)

if (this.rawValue == 1) {

          xfa.resolveNode("form1.page1.subform1.tf.font.fill.color").value = "255,255,0";

}

else {

          xfa.resolveNode("form1.page1.subform1.tf.font.fill.color").value = "0,0,0";

}

Steve

Level 3
November 8, 2011

Ok I got the script to work so is there a way to possibly lock in the color of the text that is already there and then when new text is typed - that can be a different color?