Add table of content and export to PDF
Posted: Fri Mar 07, 2014 11:33 pm
I would like to know if it is possible to add a table of content section to the "wordMLPackage" which is then exported into PDF. I know how to add it to the "wordMLPackage" to be shown in the generated Word file. But I did not succeed to actually see a table of content section in the generated PDF file. I generate the PDF as follows:
- Code: Select all
FOSettings foSettings = Docx4J.createFOSettings();
foSettings.setWmlPackage(this.wordMLPackage);
OutputStream os;
try
{
os = new java.io.FileOutputStream("my.pdf");
Docx4J.toFO(foSettings, os, Docx4J.FLAG_NONE);
}
catch (Exception e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}