Bold a single word within a sentence with iTextSharp

点点圈 提交于 2019-11-28 08:16:36

The way to accomplish what you are trying is with Chunks. A simple example is:

var normalFont = FontFactory.GetFont(FontFactory.HELVETICA, 12);
var boldFont = FontFactory.GetFont(FontFactory.HELVETICA_BOLD, 12);

var phrase = new Phrase();
phrase.Add(new Chunk("REASON(S) FOR CANCELLATION:", boldFont));
phrase.Add(new Chunk(" See Statutoryreason(s) designated by Code No(s) 1 on the reverse side hereof", normalFont));
ChrisJL

Can also create font like

Font verdanaBold = FontFactory.GetFont("Verdana", 7f, Font.BOLD);
richk

Maybe this link Bolding with Rich Text Values in iTextSharp will help?

Not sure if it fits your scenario completely but might get you where you need to go.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!