I am using the following code and jars used are docx4j-3.3.6 and docx4j-export-fo-3.3.4
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setImageDirPath("Documents\\images\\");
InputStream is = new FileInputStream(new File("Documents\\sampleword.docx"));
WordprocessingMLPackage wordMLPackage = WordprocessingMLPackage.load(is);
MainDocumentPart documentPart = wordMLPackage.getMainDocumentPart();
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 is " + key + ";; Name " + pFont.getName());
}
Mapper fontMapper = new ...