We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Word To HTML : Table with black border color - Border color is not rendered

Hello,

I'm using Aspose Words 17.3.0 to convert some .odt/.doc/.docx document to HTML.
One of my document contains a table with black border, but the black color is not rendered when I convert the document.
Here's the result:

Column 1

Column 2

 


This only happens with black color border. I tried with red for example and I didn't get this issue.

Can you help on this ?

Thank you

Hi,


Thanks for your inquiry. Unfortunately, we are unable to reproduce this issue on our end over Windows 10. Please see attached HTML file.

This HTML was created by using the HTML markup-code that you provided in your last post. We can see black borders are correctly visible when viewing with different web browsers such as Chrome, FireFox, Edge. What web browser are you using on your end and on what OS?

Best regards,

Hello,


Thank you very much for you answer.

I’m using Ubuntu 16.04. I tried with Firefox 48 and Chrome 49.
I don’t have this issue with Chrome 49 but I have it with Firefox 48.

I add a screenshot of Firefox 48.
Hi,

Thanks for the additional information. We noticed that Firefox does not render true black color for borders in Ubuntu. For the sake of any correction, we have logged this problem in our issue tracking system as WORDSNET-15167. Our product team will further look into the details of this problem and we will keep you updated on the status of this issue. We apologize for your inconvenience.

Best regards,

Hi,


Gray is the default border color for tables in Firefox if a document is opened in the “Quirks” mode. Other browsers, however, draw black borders in this case. We will take this difference into account and always export actual color of table borders. This issue reproduces in Firefox on Windows, too.

As a workaround, please export the document with HtmlSaveOptions.ExportXhtmlTransitional set to true. This would force the resulting document to be opened in the Standards mode (instead of Quirks), and the “gray border” rule wouldn’t be applied in Firefox
<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>
<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>Document doc = <span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 128); font-weight: bold;”>new <span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>Document(<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 128, 0); font-weight: bold;”>“D:<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 128); font-weight: bold;”>\<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 128, 0); font-weight: bold;”>temp<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 0, 128); font-weight: bold;”>\<span style=“font-family: “Courier New”; font-size: 9pt; color: rgb(0, 128, 0); font-weight: bold;”>Example.odt”<span style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>);
<pre style=“background-color: rgb(255, 255, 255); font-family: “Courier New”; font-size: 9pt;”>HtmlSaveOptions opts = new HtmlSaveOptions(SaveFormat.HTML);
opts.setExportXhtmlTransitional(true);
opts.setPrettyFormat(true);
doc.save(“D:\temp\awjava-17.4.html”, opts);

Hope, this helps.

Best regards,