Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
575
Apply style to a word in the middle of a string of text
posted

Is there a way to apply some sort of style or formatting to a single word, or group of words, inside of a larger string of text?  (like I just did)

 

 

Parents
  • 37774
    Verified Answer
    posted

    Take a look at the AddRichContent method off of an IText element.  Using this method will allow you to insert basic HTML tags around the words you want to format, such as:

    Report r = new Report();
    IText text = r.AddSection().AddText();
    text.AddRichContent("...a single <b><i>word,</i></b> or <b><u>group of words,</u></b>...");

    Keep in mind that if the font that you're using does not have bold versions built into the font, the bold formatting will be 'faked', which will not look the same; an example font that you would see this is MS Sans Sarif.

    -Matt 

Reply Children
No Data