How can I change the line-height of a PDF font or paragraph using iTextSharp?
Just insert "\n", should do the trick.
To set the line spacing of a paragraph in iText can be done by passing the line space / leading argument in the Paragraph constructor. In the example below we set the line space to 32 . We can also set the space between paragraph by calling the setSpacingBefore() and setSpacingAfter() methods of this object.
A good rule of thumb is to set your line height at approximately 145-150% of your text size. For example, 14px text often works well at a 21px (150%) line height, 15px text often works well at a 22px (146%) line height, and so on.
According to the PDF specification, the distance between the baseline of two lines is called the leading. In iText, the default leading is 1.5 times the size of the font. For instance: the default font size is 12 pt, hence the default leading is 18.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With