Opening office 2010 html file

Hello,

I have to open html files made by MS office 2010 but the layout is not good.

You can find an example with the attached file.

Thank you.

Hi there,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word does. Aspose.Words converts the MS Word documents to html (MS Word save option “Web Page, Filtered”). If you convert your document to HTML by using MS Word, you will get the same output.

Moreover, upon processing HTML, some features of HTML might be lost. You can find a list of limitations upon HTML exporting/importing here:
https://docs.aspose.com/words/net/load-in-the-html-html-xhtml-mhtml-format/
https://docs.aspose.com/words/net/save-in-html-xhtml-mhtml-formats/

It would be great if you please share some more detail about your query. Please share to which file format you are converting your input Html.

Hello,

Thank you, you can find below C# code used to open (html) and save the document (doc) :

Aspose.Words.License licenseWord = new Aspose.Words.License();
licenseWord.SetLicense(@"C:\RIG\Aspose\Aspose.Words.lic");
string ficHtlm = @"C:\tmp\Aspose\KBIS.htm";
string ficDoc = @"C:\tmp\Aspose\KBIS_toDoc_With_Aspose.doc";
Aspose.Words.Document _docWord = new Aspose.Words.Document(ficHtlm);
_docWord.Save(ficDoc, Aspose.Words.SaveFormat.Doc);

In attachment, I send you in the zip file with :

  • the html file,
  • doc file saved by Aspose.Word
  • doc file saved by MS Word.

Best regards,

Hi there,

Thanks for sharing the detail. I have tested the scenario and have found that the header/footer are not exported in output Word document. I have not found any other layout issue with output document.

Unfortunately, Aspose.Words does not support this feature (load HTML having headers and footers in separate files) at the moment. However, we have logged this feature request as WORDSNET-9860 in our issue tracking system. You will be notified via this forum thread once this feature is available.

We apologize for your inconvenience.

Hello,

If you look the 2 docs I sent you, there is not only header/footer problem. Aligmnent is not good at all.

Can you confirm you had exactly the same documents when you have tested ? So which Aspose.Words version do you use ?

Thank you.

Hi there,

Thanks for your inquiry.

amitel:
Hello,
Can you confirm you had exactly the same documents when you have tested ? So which Aspose.Words version do you use ?

I have used the same document (KBIS.htm) shared in this thread to test your issue. I have used the latest version of Aspose.Words for .NET 14.2.0 to test your issue.

amitel:
Hello,
If you look the 2 docs I sent you, there is not only header/footer problem. Aligmnent is not good at all.

I have tested the text alignment/position issue and have managed to reproduce the same issue at my side. The text is not vertically aligned. Please check the attached image for detail. If you are facing some different issue, please let us know.

For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-9870. 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.