When you add a TOC to a Word document, you generally do this by adding a TOC field code.
Before you can actually see the TOC in PDF output, that TOC field code needs to be converted to actual TOC entries.
Word can of course do this.
There may be some code floating around to do it using docx4j. If not, it is simple enough to write (except for the page numbers!).
Plutext's Docx4j Enterprise Edition does contain code to generate and update table of content entries, including page numbers. Its not free though. You can download a trial of that from
http://www.plutext.com/m/index.php/productsNote that depending what field args you supply, the PDF output may need some enhancement. For example dot leader (.... before page number) is not supported in 3.0.1.
As an alternative, you could try LibreOffice 4.1. It seems to generate TOC entries on open, and include them in exported PDF.