开发者

Formatting Field values using itextsharp

开发者 https://www.devze.com 2023-03-21 18:36 出处:网络
how can i have a string format \"i am fine here\" using itextsharp fields.SetField(\"tgPara2\", message2);

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

0

精彩评论

暂无评论...
验证码 换一张
取 消