使用java中的iText创建包含孟加拉语字母的Unicode pdf文件
我必须在Netbeans IDE中使用iText生成pdf文件。pdf可能包含孟加拉语字母。我已经生成了带有孟加拉语字母的pdf文件。但问题是孟加拉语字母的格式不正确 假设我必须展示:বরিশাল -- 但pdf生成:[1]: 假设我必须展示:পড়ি -- 但pdf生成:পড় ি 生成此文件的我的代码:使用java中的iText创建包含孟加拉语字母的Unicode pdf文件,java,unicode,itext,netbeans-7,Java,Unicode,Itext,Netbeans 7,我必须在Netbeans IDE中使用iText生成pdf文件。pdf可能包含孟加拉语字母。我已经生成了带有孟加拉语字母的pdf文件。但问题是孟加拉语字母的格式不正确 假设我必须展示:বরিশাল -- 但pdf生成:[1]: 假设我必须展示:পড়ি -- 但pdf生成:পড় ি 生成此文件的我的代码: Document document = new Document(); BaseFont unicode = BaseFont.createFont("c:/windows/
Document document = new Document();
BaseFont unicode = BaseFont.createFont("c:/windows/fonts/NikoshBan.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED);
Font font = new Font(unicode);
PdfWriter writer=PdfWriter.getInstance(document, new FileOutputStream("TableDat.pdf"));
document.open();
document.add(new Paragraph("বরিশাল",font));
document.close();
我不确定此修复程序是否应用于最新版本的iText,但请尝试一下:
您可以尝试使用Unicode表示法,而不只是复制粘贴孟加拉语文本。检查。另外,我建议使用Vrinda字体,因为它完全支持孟加拉文。@facebook-781042801您找到解决这个问题的方法了吗?