java - Arabic Characters in PDF -
using docx4j(3.2.0), tried generate pdf docx using 'docx4j.tofo'. arabic characters missing in pdf.
private static void createtestpdf() throws exception{ fosettings fosettings = docx4j.createfosettings(); inputstream = new fileinputstream(new file("testarabic.docx")); wordprocessingmlpackage wordmlpackage = wordprocessingmlpackage.load(is); //print available physical fonts physicalfonts.discoverphysicalfonts(); map<string, physicalfont> physicalfonts = physicalfonts.getphysicalfonts(); iterator<entry<string, physicalfont>> availablefonts = physicalfonts.entryset().iterator(); while(availablefonts.hasnext()) { entry<string, physicalfont> font = availablefonts.next(); string key = font.getkey(); physicalfont pfont = font.getvalue(); system.out.println("key " + key + ";; name " + pfont.getname()); } mapper fontmapper = new identityplusmapper(); physicalfont font = physicalfonts.get("arial unicode ms"); fontmapper.put("times new roman", font); wordmlpackage.setfontmapper(fontmapper); fosettings.setwmlpackage(wordmlpackage); outputstream pdfoutputstream = new fileoutputstream("testarabic.pdf"); system.out.println(fosettings.getsettings()); docx4j.tofo(fosettings, pdfoutputstream, docx4j.flag_export_prefer_xsl); system.out.println(" done !!!!");
}
environment : windows 7 java version: 1.6 fop: 1.1 docx4j: 3.2.0
kindly assist.
Comments
Post a Comment