pdfbox generate pdf with cyrillic characters

Viewed 1077

I create pdf using pdfbox - 2.0.6, import custom font and fulfill the document with cyrillic characters. When i test on 3 computers(2xWindows based and 1 Linux ubunto based) it`s ok. But when i deploy my code to the server(CentOS based) the code trow this exception:

java.lang.IllegalArgumentException: No glyph for U+0448 in font FontSans-BoldCyr

I tried with pdfbox default fonts (PDType1Font.TIMES_ROMAN , PDType1Font.HELVETICA) but then i get

java.lang.IllegalArgumentException: U+0412 ('Vecyrillic') is not available in this font's encoding: WinAnsiEncoding
    org.apache.pdfbox.pdmodel.font.PDType1Font.encode(PDType1Font.java:345)
    org.apache.pdfbox.pdmodel.font.PDFont.encode(PDFont.java:286)
    org.apache.pdfbox.pdmodel.PDPageContentStream.showText(PDPageContentStream.java:411)

The text that i try to wrоte on the pdf is "Вашето индивидуално предложение".

1 Answers
Related