Wrong line spacing in docx file converted to html

Hello. I’am working on line spacing with sample docx file (testdocx.png). But when i convert it to html using SaveFormat.HTML - line spacing looks different (testhtml.png). As you can see - ms office renders different line spaceses depending on font size or something, but in browser all spaces are the same.
Is it possible to render document in browser as in ms office? Thanks.

Hi Leonid,

Thanks for your inquiry. We suggest you please save the document to HtmlFixed format as shown in following code example. Hope this helps you.

If you still face problem, please share your input Word document here for testing? We will investigate the issue on our side and provide you more information.

Document doc = new Document(MyDir + "in.docx");
doc.save(MyDir + "Out.html", SaveFormat.HTML_FIXED);

Hello Tahir Manzoor. Yes i know about HTML_FIXED mode. But i have 2 problems with this mode:

  1. We need to edit rendered html in ckeditor. And looks like there are some problems with absolute positioning.
  2. We need to know about paragraph borders in document. I don’t see them in HTML_FIXED mode

Hi Leonid,

Thanks for sharing the detail. ParagraphFormat.Borders returns collection of borders of the paragraph. Please use BorderCollection class to set or get the borders of a paragraph.

Regarding the issue shared in your first post, please share your input Word document here for testing. We will investigate the issue on our side and provide you more information.