I have a problem using itext 5.
I connected a font file to display Cyrillic:
String absolutePath = context.getRealPath("") + "WEB-INF\\arial.ttf"; Font headerFont = FontFactory.getFont(absolutePath, BaseFont.IDENTITY_H, BaseFont.EMBEDDED, 14); If I pass a text string to the method right in the code, then everything is fine, the text is displayed normally:
Paragraph p1 = new Paragraph("Заявление", headerFont); But I use the properties settings file and if I transfer the variable from the properties file to the Paragraph then I already have the cracks displayed, by default the properties file is encoded with win1251, as I understood that PDF also displays the same encoding for Cyrillic display, but why I don’t works?
Paragraph p1 = new Paragraph(bundle.getString("pdf.main.header"), headerFont); When I get a string from the properties file using getString (), then the string is returned to me in UTF-16 format