While using Aspose.Words Library for Conversion words to HTML, Images & Text Gets Distorted

While using the Aspose. words library for converting words to HTML, images & get distorted. We have used the latest version 23.12 but are still getting the same issue.

2023-09-14 Heuking Art-Invest Kodak-Areal Stuttgart.docx (185.4 KB)

Pressemitteilung_Word_Vorlage.docx (2.0 MB)

Template-Test- Fachartikel_Wägezellen für Behälterverwiegung_DE.docx (4.0 MB)

@somnath.kare Please note, Aspose.Words is designed to work with MS Word documents. HTML documents and MS Word documents object models are quite different and it is not always possible to provide 100% fidelity after conversion one format to another. In most cases Aspose.Words mimics MS Word behavior when work with HTML documents.

If it is required to keep the original document layout upon importing to HTML for viewing purposes, it is better to use HtmlFixed format. In this case the output will look exactly as in MS Word:

Document doc = new Document("C:\\temp\\in.docx");
HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.setExportEmbeddedCss(true);
opt.setExportEmbeddedFonts(true);
opt.setExportEmbeddedImages(true);
opt.setExportEmbeddedSvg(true);
doc.save("C:\\Temp\\out.html", opt);

But please note, that HtmlFixed is designed only for viewing purposes not for editing or further conversion.

We have tried using HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions(); but still images getting distorted. Is there any workaround solution for that?

@somnath.kare Could you please attach your problematic input and output HTML here for our reference? I have tested with the document you have attached in your initial post and they look fine in HtmlFixed format.

@alexey.noskov I am providing the same document as input that I have attached in the initial post. Here I am attaching the output for the same documents
POUT-4162 - DOCS & HTML.zip (6.3 MB)

.

@somnath.kare The attached output HTML are flow HTML documents. Please see output HTML documents produced by the following code on my side:

Document doc = new Document("C:\\temp\\in.docx");
HtmlFixedSaveOptions opt = new HtmlFixedSaveOptions();
opt.setExportEmbeddedCss(true);
opt.setExportEmbeddedFonts(true);
opt.setExportEmbeddedImages(true);
opt.setExportEmbeddedSvg(true);
doc.save("C:\\Temp\\out.html", opt);

out.zip (4.5 MB)