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

# How to get the exact same layout in HTML as in Word

Is there a way to convert the content of a word document (without headers/footers) to HTML in a form that it is displayed exactly with the same layout (fonts, alignments, lines, line breaks etc.) as in the word document.

I know that HTML is a free flow content, but perhaps you do have a rendering option that displays the content in the same way that it is visible in the paginated word document?

@phe You can achieve this using HtmlFixed save format:

Document doc = new Document(@"C:\Temp\in.docx");
doc.Save(@"C:\Temp\out.html", SaveFormat.HtmlFixed);


If you need to specify additional option while saving to HtmlFixed, you can use HtmlFixedSaveOptions , for example:

Document doc = new Document(@"C:\Temp\in.docx");
HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.ExportEmbeddedCss = true;
opt.ExportEmbeddedFonts = true;
opt.ExportEmbeddedImages = true;
opt.ExportEmbeddedSvg = true;
doc.Save(@"C:\Temp\out.html", opt);