I am using iTextSharp to create a new pdf-file. The pdf will contain one headline and one pdf-table. The file-size of the resultant pdf-file should be as small as possible, so I use the default font (Helvetica, 12pt). Is there a way to change the default-font-size from 12pt to 8pt.
I know that I can set the font for each pdf-table-cell.
But is it possible to set the default-font-size for the whole document/table, so that I don't need to set the font for each and every table-cell extra?
(I googled on this topic, but did not find an answer)
Try this
BaseFont bf = BaseFont.CreateFont(BaseFont.TIMES_ROMAN, BaseFont.CP1252, BaseFont.NOT_EMBEDDED);
iTextSharp.text.Font font = new iTextSharp.text.Font(bf, 10, iTextSharp.text.Font.NORMAL);
Paragraph p1 = new Paragraph(new Chunk("Sample text", font));
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