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 with pages of size A3, A4 and A5.
I need to know the relation between
Font size and
PdfPCell minimum height,
so that the text will be visible.
Different concepts are at play when adding text to a cell.
setLeading(); 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
Elements added to the cell is used.
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.