With the latest available version - 8.2.9.
After loading I call only 'UpdateTableOfContents' method of the document, and save it.
As a result, the Table of Contents gets messed up.
- before updating ToC
- after updating ToC
- Code: Select all
var templateDoc = new Document(templateDocument, FileFormat.Auto);
templateDoc.UpdateTableOfContents();
var result = new MemoryStream();
templateDoc.SaveToStream(result, templateDoc.DetectedFormatType);
return result;
This is the code snippet. What am I doing wrong?