西里尔字母在Itext 7中不起作用

时间:2018-08-29 20:55:45

标签: java itext

PdfFont fontrus = PdfFontFactory.createFont(FONTrus, "CP1251", true); 
String a = "\u041e\u0442\u043a\u0443\u0434\u0430 \u0442\u044b?"; 
String b = "Привет мир"; 

Text text = new Text(a);


Text text1 = new Text(b);   
text.setFont(fontrus);
text1.setFont(fontrus); 
Paragraph paragraph = new Paragraph()
                        .add(text).setFontSize(15);
Paragraph paragraph1 = new Paragraph()
                        .add(b).setFontSize(15);

工作-

  

字符串a =“ \ u041e \ u0442 \ u043a \ u0443 \ u0434 \ u0430 \ u0442 \ u044b?”;

不起作用-

  

字符串b =“Приветмир”;

enter image description here

一切都在itext 5中起作用,但在itext7中不起作用

0 个答案:

没有答案