Chart, SmartArt, WordArt, OLE are fully highlighted with pink color because of comment attached to them

Hi Aspose support,
In our product we have functionality that converts word document to html.
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

After conversion word document to html, Chart, SmartArt, WordArt, OLE are fully highlighted with pink color because of comment attached to them.
(Left side html document -right side word document)
Issue: Issues.zip (397.3 KB)
Source documents: SourceDocuments.zip (978.5 KB)
Expected result: Converted html should be the same as word document.

Please help on this.
Thanks.

@radha.bobbili This is an expected behavior upon rendering document. MS Word behaves the same way. For example see PDF document produced by MS Word: ms.pdf (1.9 MB)

The highlighted area is the content between CommentRangeStart and CommentRangeEnd nodes of the corresponding comments. The commented text highlight color depend on the value specified in LayoutOptions.RevisionOptions.CommentColor. For example if you set the following, the commented content will be highlighted with gray.:

doc.LayoutOptions.RevisionOptions.CommentColor = RevisionColor.White;

If you need to avoid the commented content highlighting at all you can simply remove CommentRangeStart and CommentRangeEnd nodes from the document:

doc.GetChildNodes(NodeType.CommentRangeStart, true).Clear();
doc.GetChildNodes(NodeType.CommentRangeEnd, true).Clear();

In this case comments will be rendered like this: out.pdf (1.2 MB)

Thankyou for the help

1 Like