I just tried to a docx document through docx4j's sample webapp at: http://webapp.docx4java.org/OnlineDemo/docx_to_pdf_fop.html the resulting PDF file had the tables incorrectly formatted. In fact the tables were significantly off...
I'm just wondering if it's because docx4j doesn't properly support tables or it's an error of some sort. And if so, if anyone could point me to the proper information.
https://github.com/plutext/docx4j/blob/master/docx4j-samples-docx4j/sample-docs/tables.docx is an example of various table features we can process.
Without seeing your docx (and absent any description in your question of the disparity!), I'd say either:
you're using some table feature we don't support yet, or
if the document is 30 pages long, or its document.xml longer than 300KB, the faster 'non XSLT' code will be used. This code doesn't have feature parity yet.
2020 Update
For some context, there are 2 main ways to do docx to PDF in the docx4j world:
- older/cheerful approach: using docx4j-export-fo (which is the XSL FO approach discussed here, and which that tables sample document is for)
- using Microsoft Word running locally or remotely, driven by documents4j. In docx4j 8.2.0, see https://github.com/plutext/docx4j/tree/master/docx4j-samples-documents4j-local/src/main/java/org/docx4j/samples/documents4j/local or the -remote sub-project.
docx4j will automatically use export-fo if the jar is on your classpath.