-
Notifications
You must be signed in to change notification settings - Fork 364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem with display cyrillic characters as # #422
Comments
hi @MichaelZaleskovsky , I don't think openhtmltopdf support the css generated by fonts.googleapis.com. You need to follow the guide https://github.com/danfickle/openhtmltopdf/wiki/Fonts#css-font-embedding-example . So basically, you download your font (in TTF format) and define your "PT Sans" font as: @font-face {
font-family: 'PT Sans';
src: url(fonts/PTSans-Regular.ttf);
font-weight: normal;
font-style: normal;
} the url is where your font is :) Alternatively, you can register your font programmatically as described in https://github.com/danfickle/openhtmltopdf/wiki/Fonts#programatically-adding-fonts so you can avoid to define using https://fonts.google.com/specimen/PT+Sans?selection.family=PT+Sans -> you need to download the font, in the zip you will find |
with format tags. We select the truetype font. This allows some Google font stylesheets to be used (where a truetype font is provided), however, consider the network load issue if running a template multiple times. With tests for: + Simple uri which was previously all we supported. + Multiple uris/local with format tags. + Import of google CSS font sheet (manual test to avoid network load on each test run).
Assumed solved, reopen if you need to. |
Hi! I have the problem with cyrillic characters with openhtmltopdf.
I want to get PDF from html, which contains cyrillic. I use this library in servlet.
But the cyrillic simbols converted to #
I use pdfBulider in this way:
pdfBuilder
.useFastMode()
.withHtmlContent(html, "/")
.toStream(stream)
.run();
and html string contains:
<style> @font-face { font-family: "PT Sans"; src: url("https://fonts.googleapis.com/css?family=PT+Sans&subset=cyrillic"); } body { font-family: 'PT Sans', Geneva, Arial, Helvetica, sans-serif; } </style>
But it doesn't help me.
Could you help me - what is the problem?
The text was updated successfully, but these errors were encountered: