Skip to content
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

Can't read cyrillic text #40

Open
Lokki17 opened this issue Sep 12, 2017 · 0 comments
Open

Can't read cyrillic text #40

Lokki17 opened this issue Sep 12, 2017 · 0 comments

Comments

@Lokki17
Copy link

Lokki17 commented Sep 12, 2017

I'm trying to use thymeleaf and flyingsaucer to generate pdf from html-template. thymeleaf fills template and flyingsaucer create pdf-file. I'm using cyrillic font in template, but after generate pdf-file is empty.
Code
ITextFontResolver fontResolver = renderer.getFontResolver(); ClassPathResource regular = new ClassPathResource("fonts/arial.ttf"); fontResolver.addFont(regular.getURL().toString(), BaseFont.IDENTITY_H, true);
is working great, but I want to avoid this approach. So, I tried to use approach like in this example stackoverflow.com/questions/7525403/how-to-embed-font-in-pdf-created-from-html-with-itext-and-flying-saucer but it doesnt work in my case.
My html-style section:
@font-face { font-family: 'Arial Serif'; src: url('../fonts/arial.ttf'); -fs-pdf-font-embed: embed; -fs-pdf-font-encoding: Identity-H; }
and the body-tag:
body style="font-family: 'Arial Serif'"
Tell me, please, where is I've made mistake.

@Lokki17 Lokki17 changed the title Can't read cirillic text Can't read cyrillic text Sep 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant