gpc / rendering

Provides rendering of GSPs as PDFs, JPEGs, GIFs and PNGs
http://gpc.github.com/rendering
Apache License 2.0
31 stars 45 forks source link

Can't read cyrillic text #40

Open Lokki17 opened 7 years ago

Lokki17 commented 7 years ago

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.