I'm trying to set an <img src="img.png" class="default-img"> inside an XHTML string.
When running the project I see:
Feb 05, 2015 2:13:58 AM org.docx4j.org.xhtmlrenderer.util.JDKXRLogger log
INFO: Matcher created with 134 selectors
Feb 05, 2015 2:13:58 AM org.docx4j.org.xhtmlrenderer.util.JDKXRLogger log
INFO: img.png is not a URL; may be relative. Testing using parent URL file:/path/to/./
Feb 05, 2015 2:13:58 AM org.docx4j.org.xhtmlrenderer.util.JDKXRLogger log
INFO: img.png is not a URL; may be relative. Testing using parent URL file:/path/to/./
Feb 05, 2015 2:13:58 AM org.docx4j.org.xhtmlrenderer.util.JDKXRLogger log
INFO: img.png is not a URL; may be relative. Testing using parent URL file:/path/to/./
I want to use some large images, do datauri isn't going to work here and the importer seems to dislike them anyway--rejecting them as valid URLs.
When I open the generated docx in LibreOffice, I see either [MISSING IMAGE] or Read-Error. Maybe I'm not understanding how it works. Does the image get read and copied into the docx archive for portability? Does the docx need to be in the same directory as the image to load it? I'm using XHTMLImporterImpl.convert( htmlstr, null ) and XHTMLImporterImpl.convert( htmlstr, '/path/to/img/dir/' ) and different variations on that.