Bonjour,
I was able to generate a Word document with Docx4j (docx4j-JAXB-ReferenceImpl Version 11.4.10) from a template. I am trying to update the TOC of it which is defined in the template.
This produces no error but the TOC is not filled. But, this TOC is not that bad since I can update it manually by opening the produced document in Word.
I made a short Eclipse Spring project you'll find here.
Then, I tried to generate the TOC with Docx4j (in same project). Same result.
Best Regards,
Edile
You have:
tocGenerator.generateToc(1, " TOC \\h \\z \\t \"EnTete1;1;EnTete2;2;EnTete3;3\" ", STTabTlc.DOT, false);However, the t switch field args are supposed to be separated by commas:
See http://webapp.docx4java.org/OnlineDemo/ecma376/WordML/TOC.html
so try instead:
tocGenerator.generateToc(1, " TOC \\h \\z \\t \"EnTete1,1,EnTete2,2,EnTete3,3\" ", STTabTlc.DOT, true);Note: here I have also switched off page number generation since that requires additional config.