Extra text loading and Incorrect text is shown for the StyleRef field while converting docx to html

Hi Aspose support,
In our product we have functionality that converts word document to html.
After conversion word document to html, we were faced the below mentioned issues.
We used Aspose.words (23.1.0) library.
We are using Windows 10 Pro (64-bit operating system, x64-based processor) and .NET Framework 6.0

case#1:
After conversion word document to html, Extra text at the beginning of each page and at the end of the first page.
(Left side html document -right side word document)
Issue: Issue1.zip (412.9 KB)
Source document: StyleRef.docx (22.1 KB)
Expected result: Converted html should be the same as word document.

case#2:
After conversion word document to html, Incorrect text is shown for the StyleRef field on the second page.
(Left side html document -right side word document)
Issue: Issue2.zip (250.3 KB)
Source document: StyleRef.docx (22.1 KB)
Expected result: Converted html should be the same as word document.

case#3:
After conversion word document to html, Extra text at the end of the paragraph.
(Left side html document -right side word document)
Issue: Issue3.zip (557.7 KB)
Source document: StyleRef.docx (22.1 KB)
Expected result: Converted html should be the same as word document.

Please help on this.
Thanks.

@radha.bobbili The first and the second cases are the same. Aspose.Words updated the { STYLEREF "Footnote Reference" } field differently than MS Word.

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): WORDSNET-24896

You can obtain Paid Support services if you need support on a priority basis, along with the direct access to our Paid Support management team.

The second case is not a defect, since if update fields in the document in MS Word it will show exactly the same output.

All the mentioned differences occur because Aspose.Words automatically updates fields in the document before rendering the document. You can disable this using HtmlFixedSaveOptions.UpdateFields:

HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.UpdateFields = false;

However, this will not fix the problem with { STYLEREF "Footnote Reference" } in the document’s header, since fields in header/footer are always updated

Thank you for the response and support.

1 Like

The issues you have found earlier (filed as WORDSNET-24896) have been fixed in this Aspose.Words for .NET 23.8 update also available on NuGet.