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

Free Support Forum - aspose.com

Image is not displayed while converting doc to HTML

Dear Support,

While converting the doc to HTML in stream. The output HTML doesn’t contains any image.
Code used:

Document doc = new Document(ms);
MemoryStream HTML_STREAM = new MemoryStream();
doc.Save(HTML_STREAM, SaveFormat.Html);
Response.ContentType = "text/HTML";
Response.AddHeader("Content-DataType", "byte-type");
Response.BinaryWrite(HTML_STREAM.GetBuffer());
Response.Flush();
Response.End();

Please provide details or code snippet to resolve this issue without saving the image to disk.

Thanks

Hi
Thanks for your request. When you save the document to Stream in HTML format images are stored on the disk. HTML does not allow embedding images into the document. You can specify folder where images will be stored.
https://reference.aspose.com/words/net/aspose.words.saving/htmlsaveoptions/imagesfolder/
https://reference.aspose.com/words/java/com.aspose.words/htmlsaveoptions/#getImagesFolder--
Best regards.

However if you need embedded images you can try using MHTML format.
https://docs.aspose.com/words/net/convert-a-document-to-html-mhtml-or-epub/