Page 1 of 1

Problems with Converting to HTML

PostPosted: Thu Oct 30, 2008 10:07 pm
by doxmarc
Hi all,

has anyone tried the "ConvertHTML" sample shipped with docx4j? Today, I installed docx4j for being used with my eclipse (Ganymede) according to the installation guidelines.

When trying the ConvertHTML example, I *always* got an
Exception in thread "main" java.lang.OutOfMemoryError: Java heap space

I got the exception in the "org.docx4j.convert.out.html.HtmlExporter.html" method, with configured heap spaces (of up to 1 GB). I also tried several documents, including the ones delivered with docx4j.

Any ideas?

Thanx and with best regards,

marc

Re: Problems with Converting to HTML

PostPosted: Sun Nov 02, 2008 11:32 pm
by jason
Hi

(For the benefit of others) you are using docx4j from SVN, since you are using the new org.docx4j.convert.out.html.HtmlExporter class.

This HTML converter is improved over the old one, since it uses the newer XSLT from Microsoft's OpenXMLViewer, with new extension functions to handle images and numbering.

(As an aside, I am considering a different approach, since the XSLT is largely incomprehensible, and the result HTML not as clean as it could be)

I run it from Eclipse as well. In the Eclipse run dialog VM arguments, I have "-Xmx512M -Xss1024K"
(that's in addition to java.endorsed.dirs and log4j.configuration).

Are you setting Eclipse's memory there, or just for eclipse generally?

If you have adequate settings in the run dialog VM args, then I'm not sure: perhaps the problem is in analysing your system fonts; maybe you have a lot of these? I'm running on Linux; what are you running Eclipse on?

cheers

Jason