Reputation: 1659
In Itext
what is the minimum height of a pdfpcell
for which a given size of font
text is visible. I mean is there any ratio between pdfpcell
and font
size?. I am making a pdf for A3
, A4
and A5
size pages. So I need a factor between Font
size and Pdfpcell
minimum height, so that the text can be visible. or is there any other way so that pdfpcell
can shrink minimum in height so that the text may be visible?
Upvotes: 0
Views: 1495
Reputation: 77528
Different concepts are at play when adding text to a cell.
setPadding()
method.setLeading()
method; you can define a fixed leading (fixedLeading
), or a leading that depends on the font size (multipliedLeading
). This value is ignored if you're working in composite mode. In composite mode, the leading of the separate Element
s added to the cell is used.setUseAscender()
and setUseDescender()
.So, if you want the cell to have a minimal size, you need to set the padding to 0, the leading to match the size of the font, and tell iText to use the ascender and descender value.
DISCLAIMER: in the past, we've received reports from customers that showed us that not all fonts contain the correct ascender and descender information. This needs to be fixed at the font level.
Upvotes: 1