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

Free Support Forum - aspose.com

Heder header misalignment in Docx to HTML convertion

I am testing Aspose.Word for feasibility. I am facing problem with converting Docx to HTML.

I am using below code :

Document doc = new Document("C:\TestDoc.docx");

in attached document, header is on right side, but in html it goes left side and some other text on right side.

and otherthing is, is it possible to keep text instead of converting to image at same position in docx.


Hi Paresh,

Thanks for your inquiry.

I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-10379. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved. We apologize for your inconvenience.

As a workaround, please use the following code. Hope this helps you.

Document doc = new Document(MyDir + "TestDoc.docx");
HeaderFooter hf = doc.FirstSection.HeadersFooters[HeaderFooterType.HeaderPrimary];
foreach (Shape shape in hf.GetChildNodes(NodeType.Shape, true))
     shape.ParentParagraph.ParagraphFormat.Alignment = ParagraphAlignment.Center;
doc.Save(MyDir + "Out//Out.html");

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

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