Free Support Forum - aspose.com

Cannot see text in header if using InsertHtml() to insert a <table>

I used below code to create content of header:

doc = new Aspose.Words.Document();
builder = new DocumentBuilder(doc);
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
string hContent = “

header text
”; builder.InsertHtml(hContent);

After saving to file, I cannot see the text in header. But if I set the border of table to ‘1’, everything in header is good.

Could you please help me to show text in header if the table doesn’t has border like above code?

Thanks

Hi

Thanks for your inquiry. I tried to use your code and it seems that all works fine on my side. I used the latest version of Aspose.Words for testing. Try to update your Aspose.Words.

The latest version of Aspose.Words is available for download from here.

Please, let me know if this will not help you.

Best regards.

Thanks for your support.

I downloaded the latest version, but the issue also exists. I’m using
MS Word 2000. I tested on MS Word 2003, it’s fine to see all content on
header.



Please help me to resolve the issue on MS Word 2000. See attached output on Word 2000.



Thanks

Hi

Thanks for your reporting this problem to us. I managed to reproduce the problem. I have logged this problem to our defect database as issue # 3979. Please expect a reply before the next hotfix (within 2-3 weeks).

Also you can use workaround to solve this problem. See the following code.

Document doc = new Aspose.Words.Document();

DocumentBuilder builder = new DocumentBuilder(doc);

builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);

builder.InsertCell();

builder.Write("header text");

builder.EndRow();

builder.EndTable();

doc.Save(@"309_100398_phucbui\out.doc");

Best regards.

Thanks. But the input is anything in HTML, it can be table or another tags.

Waiting for the hot fix.

Best regards.