I'm using OpenHTMLToPDF to get PDF of HTML but I got # character in my pdf instead of actual characters. I'm using DejavuSans font and I passed to code like this:
try (InputStream is = pdfTtfFile.getInputStream()) {
pdfRendererBuilder.buildPdfRenderer().getFontResolver().addFont(() -> is, "deja-sans", null, null, false);
} catch (IOException e) {
logger.warn("error while loading DejaVuSans_1.ttf font", e);
}
I also used deja-sans as font family for body tag:
body {
font-family: 'deja-sans';
}
I have to get this is in PDF: "Hello World! Fıstıkçı Şahap İlkay Günel"
But I'm getting this in PDF: "Hello World! F#st#kç# #ahap #lkay Günel"
According to sandbox, deja-sans should be fine for me but I don't know what is wrong? Why does it show # instead of my characters?