Table header changes to bold format while converting doc to html

Hi,

I want to convert my document into html format and my document having no.tables. I used the following code to convert doc into html format:

Document import = new Document(@"D:\1.doc");
MemoryStream htmlstream = new MemoryStream();
import.Save(htmlstream, SaveFormat.Html);
string html = System.Text.Encoding.UTF8.GetString(htmlstream.GetBuffer(), 3, (int) htmlstream.Length - 3);

If we open the html in browser, all the table headers are formatted to bold format even document tables doesn’t have bold format. Please let me know how to avoid this?

Thanks,

Hi

Thanks for your inquiry. Could you please attach your input and output documents here for testing? I will check the problem on my side and provide you more information.

Best regards,

Hi,
PFA for my test document. It contains only one table. when I run my previos post code on this document, the variable ‘html’ is having html format of document. If you open this ‘html’ on web page, you can find the difference in table. The first row of the table is formatted with bold, but in original document it doesn’t have like that.
Thanks,

Hi

Thank you for additional information. I managed to reproduce the problem on my side. Your request has been linked to the appropriate issue. You will be notified as soon as it is fixed.
Best regards,

Hi,
Thanks for your response. Let me know when it could be fixed and as workarround Is there any other way to convert doc into html to fix this?
Thanks,

Hi
Thanks for your inquiry. Currently I cannot provide you any reliable estimate regarding this issue. You will be notified as soon as it is resolved.
Please try using the following code to work this problem around:

Document doc = new Document("1.doc");
// Get all rows
Node[] rows = doc.GetChildNodes(NodeType.Row, true).ToArray();
// Loop through all rows in the table and set HeadingFormat to false.
foreach(Row row in rows)
{
    row.RowFormat.HeadingFormat = false;
}
doc.Save("out.html");

Best regards,

The issues you have found earlier (filed as WORDSNET-3726) have been fixed in this .NET update and this Java update.

This message was posted using Notification2Forum from Downloads module by aspose.notifier.