CharacterFormat in Hyperlink


Is there a way to change the CharacterFormat of a Hyperlink ?
In the documentation it’s written that we can, like Run or Field, but the property isn’t accessible on Hyperlink.

I tried to create a Field with FieldType.Hyperlink, wich allows me to access to CharacterFormat, but then I don’t find how to change the value of the Field’s Hyperlink.

Thanks for your help !


You can create a Run element and provide it to the Hyperlink as its display inline.
For example, try this:

var hyperlink = new Hyperlink(document, "",
    new Run(document, "GemBox") { CharacterFormat = { FontColor = Color.Red } });

Does it solve your issue?


Yes, perfect !

Thanks Mario