About heading style render

the problem is: the list-numbered heading in word after export to html by Aspose.words and reopened in word has lost or change some style.
the detail is:

  1. heading style changed, for example the heading line spacing is much more bigger and the left indent is also changed.

i don’t know how to upload image in this forum, so you can see the image in my skydriver:
https://pjkzua.dm2301.livefilestore.com/y2pJcCgKswESvhz2-PVJj7aC9jbsiNzZlKcsi3Ky2z_N4j0HGUswlReMX2SPzG6G4BXdki-6nUtDtUe7_mmYar_8FazxQiPrqgHMFAQXAO5Jw4/html2.png?psid=1

Hi Pyntia,

Thanks for your inquiry. Please note that Aspose.Words mimics the same behavior as MS Word do. Please convert your document to HTML by using MS Word and check the HTML output. 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
following detail for investigation purposes.

  • Please attach your input Word document.
  • Please

create a standalone/runnable simple application (for example a Console
Application Project
) that demonstrates the code you used to generate
your output document

Unfortunately,
it is difficult to say what the problem is without the Document(s) and
simplified application. We need your Document(s) and simple project to
reproduce the problem. As soon as you get these pieces of information to
us we’ll start our investigation into your issue.

hi, Tahir Manzoor

if use word itself export to html and reopen again, the style will be undifferent. i think this is Aspose.Words problem.

i don’t know how to upload attechment in this forum, you can download the source document and the simple code in below link:
http://pan.baidu.com/s/15WV4M

thanks

Hi Pyntia,

Thanks for sharing the documents.

Please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your document to HTML by using MS Word, you will get the same output.

In case you are using an older version of Aspose.Words, I would suggest you please upgrade to the latest version (v13.11.0) from here and let us know how it goes on your side.

I have converted the shared document to html and have not found any issue with output html. Aspose.Words saves any loaded document that to valid HTML 4.0 or XHTML 1.0 specifications. I have attached the output HTML with this post for your kind reference.

hi, Tahir Manzoor

thank you for your reply

i will trying the latest version than tell you result.

thanks

Hi Pyntia,

Please try the latest version of Aspose.Words for .NET 13.11.0 and let us know if you face any issue.

i use the latest version 1.3.11 and unfortunately it has no better than the 1.3.10.

these three picture will show the exact diff:
the orginal word style:
https://pjkzua.dm2304.livefilestore.com/y2pnldOPdDlyyRIM6ffqdLcLntVTHee54Pcq0YtFzyt1zJpM1gUzU0QrC6TA5oQv4yltg_PUIyTVbHafKv26Rj_uN0ygtYCyLvC_MRSJ6gwIRU/orginal.jpg?psid=1

the word_html_output rerender style:
https://pjkzua.dm2304.livefilestore.com/y2pBRV3mpydI7r5ATaHqdO1wEYWdCzG7HQ7a_Ye3ncBKBCSuX_28fK3jfto8S7BTJmJwEQPpTWb7k9UgzMEDR1kPJbb8kwylPUmVHW_A7AlFbw/word_output_html.jpg?psid=1
you can see the rerender style is so wanderful which is exact the same between orginal.

the aspose_html_output rerender style:
https://pjkzua.dm2302.livefilestore.com/y2pTkhuWuDZGxuYzMG6L5qSD6KEf5gVWuaeHzlz6z37hV7qpihALgAWxxVdKtUnb1yCQP4wxrSV8HW_6shQXO251AdV9RO0WMrH0UKgOKXEb7E/aspose_html_output.jpg?psid=1
at least two obvious diff: page layout setting and headline setting

the word example document i have post already, can you please check it again?
tks

Hi Pyntia,

Thanks for your inquiry. Aspose.Words converts the MS Word documents to html (MS Word save option “Web Page, Filtered”). Please convert your document to HTML (“Web Page, Filtered”) by using MS Word and check the HTML output. The number list issue which you are facing is due to missing feature (mso-list attribute).

Currently most of the special Microsoft “Mso” attributes, which are normally added by Microsoft Word to HTML output to make it round-trip capable back to Word formats, are not written during export to HTML or MHTML. This makes the HTML produced by Aspose.Words much cleaner than the output produced by Microsoft Word which is often bloated with these many round-trip based attributes.

I have logged this feature request as WORDSNET-9451 in our issue tracking system. You will be notified via this forum thread once this feature is available.

Please read following documentation links for your kind reference.
https://docs.aspose.com/words/net/document-features-supported-on-html-export/
https://docs.aspose.com/words/net/save-in-html-xhtml-mhtml-formats/

Regarding page margin issue, please use HtmlSaveOptions.ExportPageSetup property to specify whether page setup is exported to HTML. Please check the following code example.

Document doc = new Document(MyDir + "in.docx");
HtmlSaveOptions options = new HtmlSaveOptions();
options.ExportPageSetup = true;
doc.Save(MyDir + "Out.html", options);

Moreover, each Section in Aspose.Words document model provides page setup information via PageSetup class. When you export a document to HTML format you might need to keep this information for further usage. In particular, page setup might be important for rendering to paged media (printing) or subsequent conversion to the native Microsoft Word file formats (DOCX, DOC, RTF, WML).

hi, Tahir Manzoor

thanks a lot for explain so detailed

Hi Pyntia,

Thanks for your feedback. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.