We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Appendix Headings Incorrect in TOC


I am having problems updating a Table of Contents. The attached sample documents display the issue, but basically, we are using a custom heading that contains Appendix Numbers. As you can see in the documents, the Appendix titles are split from the numbers (with leaders) and the page numbers are split by what looks to be a tab from the titles. The page numbers should be split from with title with leaders and the title should be split from the number with a space (the same as the rest of the TOC entries). Also, the page numbers appear outside of the margins, so they are not lined up with the page numbers above. I used the following code to produce the error.

  1. Dim wrdDoc As New Aspose.Words.Document("test.doc")
  2. wrdDoc.UpdateFields()
  3. wrdDoc.Save("test.pdf", SaveFormat.Pdf)

Thanks in Advance

Hi Matthew,

Please try the code below. It produces PDF with correctly looking TOC .

Dim wrdDoc As New Aspose.Words.Document(“test.doc”)
wrdDoc.Save(“test.pdf”, SaveFormat.Pdf)


Worked great.