I am working on an application where we have some content that is provided by our users as HTML and that content can contain HTML. If we insert some HTML in an Aspose Word Document that contains a table, it seems to prevent us from changing the color of future tables created directly without HTML.
Here’s a repro-case:
String html = “
DocumentBuilder docBuilder = new DocumentBuilder();
Cell cell = docBuilder.insertCell();
docBuilder.write(“I should be blue, green or yellow”);
In this code, an HTML table is inserted with a cell with a red background. Then a second table is inserted but I can’t do anything to get the cells in this table to not be red. As you can see, I’ve tried using the CellFormat property on the DocumentBuilder both before and after as well as the CellFormat on the cell itself. In the above, the code that tries to set the cell color to blue and then green and then yellow, but none of those work. The cell remains red.
If I comment out the insertHtml call, then I get a green cell as I would expect.
I am using Aspose.Words 2.4.2 for JDK 1.5.