I see this issue surface on 3.0. Here is the code:
- Code: Select all
HTMLSettings htmlSettings = Docx4J.createHTMLSettings();
htmlSettings.setFontFamilyStack(false);
htmlSettings.setImageDirPath("." + "_files");
htmlSettings.setImageTargetUri("_files");
htmlSettings.setWmlPackage(wordMLPackage);
Docx4jProperties.setProperty("docx4j.Convert.Out.HTML.OutputMethodXML", true);
ByteArrayOutputStream os = new ByteArrayOutputStream();
Docx4J.toHTML(htmlSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);
os.flush();
The code errors out at the following line " Docx4J.toHTML(htmlSettings, os, Docx4J.FLAG_EXPORT_PREFER_XSL);"
Here are the debug and exception logs:
EBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 1 0 0 2 Regular
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 1 0 0 3 Gurmukhi MT; 6.0d2e1; 2006-10-20
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 1 0 0 4 Gurmukhi MT
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 1 0 0 5 6.0d2e1
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 1 0 0 6 MonotypeGurmukhi
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 1 0 0 7 Monotype Gurmukhi is a Trademark of Monotype Typography Ltd.
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 1 0 0 256 Alternates
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 1 0 0 257 Show Invisibles
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1028 2 ???
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1030 2 Ordin?r
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1031 2 Normal
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1033 2 Regular
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1035 2 Normaali
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1036 2 Normal
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1040 2 Regolare
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1041 2 ?????
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1042 2 ???
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1043 2 Regulier
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1044 2 Normal
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1046 2 Normal
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1049 2 ???????
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 1053 2 Normal
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 2052 2 ???
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readName line 1236 - 3 1 3082 2 Normal
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readCMAP line 226 - 1 cmap tables
DEBUG org.docx4j.fonts.fop.fonts.truetype.TTFFile .readCMAP line 236 - Platform ID: 0 Encoding: 3
ERROR org.docx4j.fonts.fop.fonts.truetype.TTFFile .readCMAP line 252 - Unsupported TrueType font: No Unicode or Symbol cmap table not present. Aborting
WARN org.docx4j.fonts.PhysicalFonts .addPhysicalFont line 216 - Aborting: file:/Library/Fonts/Gurmukhi.ttf (can't get EmbedFontInfo[] .. try deleting fop-fonts.cache?)
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space
at org.apache.commons.io.output.ByteArrayOutputStream.needNewBuffer(ByteArrayOutputStream.java:127)
at org.apache.commons.io.output.ByteArrayOutputStream.write(ByteArrayOutputStream.java:154)
at org.apache.commons.io.IOUtils.copyLarge(IOUtils.java:1026)
at org.apache.commons.io.IOUtils.copy(IOUtils.java:999)
at org.apache.commons.io.IOUtils.toByteArray(IOUtils.java:218)
at org.docx4j.fonts.fop.fonts.truetype.FontFileReader.init(FontFileReader.java:51)
at org.docx4j.fonts.fop.fonts.truetype.FontFileReader.<init>(FontFileReader.java:80)
at org.docx4j.fonts.fop.fonts.autodetect.FontInfoFinder.find(FontInfoFinder.java:217)
at org.docx4j.fonts.PhysicalFonts.addPhysicalFont(PhysicalFonts.java:208)
at org.docx4j.fonts.PhysicalFonts.addPhysicalFont(PhysicalFonts.java:196)
at org.docx4j.fonts.PhysicalFonts.discoverPhysicalFonts(PhysicalFonts.java:144)
at org.docx4j.fonts.IdentityPlusMapper.<clinit>(IdentityPlusMapper.java:74)
at org.docx4j.openpackaging.packages.WordprocessingMLPackage.getFontMapper(WordprocessingMLPackage.java:337)
at org.docx4j.fonts.RunFontSelector.getPhysicalFont(RunFontSelector.java:773)
at org.docx4j.fonts.RunFontSelector.<init>(RunFontSelector.java:85)
at org.docx4j.convert.out.html.HTMLConversionContext.createRunFontSelector(HTMLConversionContext.java:129)
at org.docx4j.convert.out.html.HTMLConversionContext.<init>(HTMLConversionContext.java:124)
at org.docx4j.convert.out.html.AbstractHTMLExporter3.createContext(AbstractHTMLExporter3.java:60)
at org.docx4j.convert.out.html.AbstractHTMLExporter3.createContext(AbstractHTMLExporter3.java:29)
at org.docx4j.convert.out.common.AbstractExporter.export(AbstractExporter.java:67)
at org.docx4j.Docx4J.toHTML(Docx4J.java:502)
at com._21ct.msword.MsWordTemplate.convertTemplateToHtml(MsWordTemplate.java:210)
at com._21ct.msword.MsWordTemplate.main(MsWordTemplate.java:82)