While converting this document (see attached) from Word to HTML we experience some kind of infinite loop
We use a custom saving strategy that looks like:
// Convert to HTML using HtmlFixedSaveOptions
var options = new HtmlFixedSaveOptions
{
CssClassNamesPrefix = "pre-",
PageIndex = 1,
PageCount = document.PageCount,
ShowPageBorder = false,
PageSavingCallback = new DataFlowPageSavingCallback(DataflowPipelineUnit),
ResourceSavingCallback = new DataFlowResourceSavingCallback(AnotherPipelineUnit),
ExportEmbeddedFonts = false,
ExportEmbeddedCss = true,
FontFormat = ExportFontFormat.Ttf
}
using (var ms = Stream.Null)
{
document.Save(ms, options);
}
A subsequent call to document.GetPagesMetadata() reveals that there are 21 pages (which is true).
The PageSavingCallback is only called 20 times, indicating that processing is stuck for one of the pages.
After testing multiple changes, it seems that we’ve narrowed it down to the Table of Contents.
Putting an empty paragraph (hitting enter) between the section break and the Table of Contents allows the document to be converted successfully.
The working theory is that it is some weird interaction with Section Breaks and the Table of Contents.
I’ve attached a minimal version of the document that still has the issue.
Aspose Minimal Reproduction.zip (104.4 KB)