17

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

Petrus Theron
  • 27,855
  • 36
  • 153
  • 287

3 Answers3

27

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

Mitch
  • 21,223
  • 6
  • 63
  • 86
7

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.

semao
  • 71
  • 1
  • 1
4

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;
Steve
  • 5,802
  • 12
  • 54
  • 76