4

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.

Kara
  • 6,115
  • 16
  • 50
  • 57
Stephane Grenier
  • 15,527
  • 38
  • 117
  • 192

1 Answers1

4

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:

  1. you're using some table feature we don't support yet, or

  2. 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 Sept Update

For some context, there are 3 main ways to do docx to PDF in the docx4j world:

docx4j will automatically use export-fo if the jar is on your classpath.

For a comparison between these approaches, see https://www.docx4java.org/blog/2020/09/office-pptxxlsxdocx-to-pdf-to-in-docx4j-8-2-3/

JasonPlutext
  • 15,352
  • 4
  • 44
  • 84
  • Are table related features paid? I tried from 'MergeDocx' but it asks for license. Or there is any other class which have examples of table manipulation. – Vikash Sep 04 '20 at 08:42
  • 1
    You'd only need MergeDocx if you wanted to concatenate/append docx files. Please post your table manipulation question as a new question – JasonPlutext Sep 05 '20 at 00:59
  • I was able to do it. thanks for clarifying the mergeDocx usage. – Vikash Sep 05 '20 at 05:18