Formatting Field values using itextsharp
how can i have a string format "i am fine here" using itextsharp fields.SetField("tgPara2", message2); where message is "i am fine here" i want t开发者_C百科he fine word only to be bold. Any help would be
iText has partial support for "rich text values" for text fields. You can get and set the rich values, but iText won't actually draw those values properly. You need to turn off SetGenerateAppearances
, and open the PDF in Acrobat/Reader to see the rich text.
This means flattening isn't going to work (unless you open the PDF in Acrobat, then save it again... clunky).
You might want to check out the PDF Specification (Section 12..7.3.4 Rich Text Strings) for further information on what is and isn't legal. <b>
is legal, as is the font-weight
CSS style
精彩评论