How to set PDF paragraph or font line-height with iTextSharp?

孤者浪人 提交于 2019-12-20 17:37:31

问题


How can I change the line-height of a PDF font or paragraph using iTextSharp?


回答1:


Line spacing in terms of typography is called leading. If you can use line spacing, you can use Paragraph.Leading or Paragraph.LeadingMultiplier. See http://itextsharp.sourceforge.net/tutorial/ch02.html#phrase




回答2:


paragraph.SetLeading(X, Y) where X - is fixed leading and Y is leading multiplayer. Leading is space between two text baselines. Final leading value is calculated like: X+Y*max font size in row.




回答3:


Not sure in what context your text is in, but I have mine in a PdfCell and I used MinimumHeight and PaddingTop:

cAddr = new PdfPCell(ptAddr);
cAddr.MinimumHeight = 101.0F;
cAddr.PaddingTop = 30;


来源:https://stackoverflow.com/questions/2630430/how-to-set-pdf-paragraph-or-font-line-height-with-itextsharp

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