HTML -> Doc conversion (borders and Shanding vs. Highlighting)

We use ASPOSE to convert an HTML document to a Word document. Using FCKEditor we can mimic Word in a web application. When highlighting a section in FCKEditor it creates span tag like “Some random text” The problem is "style=“background-color: #ff6600” is read by ASPOSE as being a borders and shading property instead of a highlighting property. This is confusing to our users because they think that the words are highlighted, not shaded. Is there an HTML tag that ASPOSE will convert to a MSWord highlighting element? We can alter FCKEditor to use those tags and thus save us lots of heartache and explaining. PLEASE Help. The users just can’t get the difference.

Hello Nick!

Thank you for your interesting question.

When working with HTML (import, export) Aspose.Words tends to “pure” HTML without Microsoft Office “magic”. I mean a plenty MS Office specific attributes that the most customers really don’t like. You can see what happens with any of your documents when exporting them from MS Word to HTML format. Although we make some exceptions for important features, they are usually optional.

To mark highlighted text MS Word exports its specific attribute mso-highlight like in the following sample:

<span style='background:red;mso-highlight:red'>red</span>

Browsers might have nothing to do with mso-highlight so they also export ordinary background. There are no attributes in “pure” HTML to distinguish highlighting and shading. And the idea to import/export mso-highlight is not very good.

You can work-around this case by replacing shading by highlighting after HTML import. This can be accomplished unless you need to have both shaded and highlighted text in the same document. See Shading and HighlightColor in this table:

Let us know whether the workaround is suitable for you and information is helpful.

I have created a new issue #9194 in our defect database:
#9194 – Consider distinguishing shading color and highlight color
Most probably workaround is suitable for you. But in the future we’ll consider this improvement.