I am creating a pdf with some content in it. My requirement is to reduce the space between lines while creating the pdf so that more number of lines fit in single page.How can i reduce the space between lines,please suggest.
Document document = null;
Font font = new Font(Font.FontFamily.COURIER,12);
//code to get the content to show in the document
for (final String line : documentines.getDocumentLine())
The space between two lines is called the leading.
You change it with the
Note: by default, iText takes 1.5 times the font size. If the font size is 12, the leading will be 18 by default.
You can also set the leading in the constructor: http://itextsupport.com/apidocs/itext5/latest/com/itextpdf/text/Paragraph.html#Paragraph-float-java.lang.String-com.itextpdf.text.Font-
document.add(new Paragraph(15, line, font));