Doc.updateFields(), you have to manually update the entire directory after opening word. Moreover, the table of contents is inconsistent with the first-level heading, and there should be two spaces between the serial n…...Crane March 25, 2025, 4:04pm 1 doc.updateFields(), you have to manually...TOC and update it: Document doc = new Document(); DocumentBuilder...