Color : RGBA in HTML does not Import into Aspose.Words DOM using .NET

When using DocumentBuilder.InsertHtml to add html content to a word document, any colors specified using “rgba” are ignored completely.

You can demonstrate this on Convert Files Online - Word, PDF, HTML, JPG And Many More as follows:

  1. Extract the file “test.html” from the attached zip file
  2. Open the file in your browser and note that all 4 lines are colored
  3. Upload the file to Convert Files Online - Word, PDF, HTML, JPG And Many More and download it as a DOCX file
  4. Note that only 2 of the lines are colored

test.zip (286 Bytes)

@mwaddell

Please note that Aspose.Words mimics the behavior of MS Word. If you open the HTML in MS Word, you will get the same output. However, we have logged new feature request as WORDSNET-22433 to import the color formatting with Color : rgba() into Aspose.Words’ DOM. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

1 Like

@mwaddell

Your issue (WORDSNET-22433) has been closed with ‘Won’t Fix’ resolution.

Aspose.Words’ document model does not support colors that are not fully opaque and sets alpha value of all colors to 1. As a result, we cannot fully support “rgba()” and “hsla()” CSS functions.