I use docx4j 3.0.0 via sbt, and I try to get some sample pdf output using such code
- Code: Select all
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setWmlPackage(wordMLPackage);
Mapper fontMapper = new BestMatchingMapper();
fontMapper.getFontMappings().put("Simsun", PhysicalFonts.getPhysicalFonts().get("SimSun"));
wordMLPackage.setFontMapper(fontMapper);
/*
for ( String name:PhysicalFonts.getPhysicalFonts().keySet() ){
Logger.info("found font:" + name);
}*/
OutputStream os = new java.io.FileOutputStream(settings.Constant.DEBUG_PATH + "/test.pdf");
Docx4J.toFO(foSettings, os, Docx4J.FLAG_NONE);
but when I run this simple program I got a pdf with '#' everywhere... which should all be some chinese charactors...
well I run it on my mac and it does have the needed font 'Simsun'. the program complains no error or exception while excuting.
I read some old posts in this forum, and I used reveal formatting in word on those charactors and I did get 'font:SImsun' >"<
I tried to use the demo webapp on this site but unfortunately I still got #############
here is my docx and the result pdf, I would be really appreciate if someone can help me with it... >"<