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

Free Support Forum - aspose.com

Converting docx to mhtml

I need to convert docx to mhtml. The mhtml viewer I am using requires the Content-Location: to start with file:///. When Aspose converts the document I get the header below. I'd like for Aspose to output the last line as "Content-Location: file:///.../document.html". Also, I'd like to try and remove the Content-Disposition: inline;. When I take the docx file and Save As... (mhtml) it does this for me automatically. Thanks.

Conversion code:
// stream is a docx file
Document doc = new Document(stream);
MemoryStream streamOut = new MemoryStream();
doc.Save(streamOut, SaveFormat.Mhtml);

Ouput header:
MIME-Version: 1.0
Content-Type: multipart/related;
type="text/html";
boundary="=boundary.Aspose.Words=--"

This is a multi-part message in MIME format.

--=boundary.Aspose.Words=--
Content-Disposition: inline;
filename="document.html"
Content-Type: text/html;
charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Location: document.html

Hi Steve,


Thanks for your inquiry. I think, you can simply post-process Aspose.Words generated MHTML file and remove undesired text/string from it and of-course replace [Content-Location: document.html] with another string using standard C# methods.

Best regards,