Font-family ignored when rendering html-pre to pdf

Viewed 26

When I convert html with in-line styles to pdf, the font-family works on every tag I have tried except from pre. It seems that when a pre is converted to IBlockElement and then added to the document, the specific font is ignored and either the default font (Times) or a default monospace font is used, but never the exact font I request. Since the font-family works fine with p and td and div, I guess there must be something special with pre. Also, the same fonts work fine when creating normal Paragraphs from strings and specifying fonts or styles with fonts. I have solved my specific problem by converting the pre to a string (with Jsoup) and then to a Paragraph with a style with a font. But I though I should write here so that someone can look into this a determine whether or not it is a bug that should be fixed.

Just in case it matters: I am using Java and itext7-core 7.2.3 and html2pdf 4.0.3 on linux (kubuntu)

0 Answers
Related