I'm adding Elements from an ElementList to a PdfPCell. These elements can be anything from simple text phrases to bulletpoint lists. However, the font with which these elements are printed to the pdf is too big size. So, my question is: How to adjust the default font size for elements which are parsed to the pdf.
I know how to do it with paragrhaps, where you can enter the string and the font as parameters, but how to do that when adding elements to the cell as follows:
PdfPCell cell = new PdfPCell();
for (Element e : XMLWorkerHelper.parseToElementList(HTML, CSS)) {
cell.addElement(e);
}
table.addCell(cell);
I found at least one way to do it by getting the chunks out of each element and setting the font for that chunk. ie:
Font f = new Font();
f.setSize(8);
for (Element e : XMLWorkerHelper.parseToElementList(content, null)) {
for (Chunk c : e.getChunks()) {
c.setFont(f);
}
cell.addElement(e);
}
table.addCell(cell);
}