Skip to content
Advertisement

HTML to PDF with cyrillic characters

I’m making a Spring Boot application. I want to generate PDF from HTML code:

JavaScript

As you can see there is a h3 tag with cyrillic symbols. The problem is that after conversion and saving the symbols are not presented in PDF (it’s simply empty, because there is nothing more in html code to be visible). Other symbols are being displayed properly btw.

For html-to-pdf conversion i use:

JavaScript

I suppose there is a problem with charset, fonts etc. How can I fix it?

Advertisement

Answer

This worked for me!

JavaScript

enter image description here

I think the trick is to add the CSS to the HTML and the font must match what you set on the PDF.

User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement