Skip to content

Can't read cyrillic text #40

@Lokki17

Description

@Lokki17

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions