wooio / htmltopdf-java

An HTML to PDF conversion library written in Java, based on wkhtmltopdf.
MIT License
172 stars 97 forks source link

Character references #42

Open ringhedj opened 4 years ago

ringhedj commented 4 years ago

Seems to have an issue interpreting '&nbsp ; Anyone have a workaround?

` Capture CaptureHtml

`

maksgraczyk commented 4 years ago

I had a similar problem with Unicode characters on Windows and its cause was very subtle in my case. I fixed it by setting jna.encoding explicitly to utf8. One way to do this is running System.getProperties().setProperty("jna.encoding", "utf8"); before calling any htmltopdf code.