Hello,
We are using Aspose Words to transform mhtml documents into png images and pdf.
Sometimes inline image embedded in the mhtml is not displayed.
This problem can be reproduced on the attached sample with this code :
LoadOptions options = new LoadOptions(LoadFormat.Mhtml, null, null);
var document = new Document(@“C:\test\test.mht”, options);
// Png
ImageSaveOptions imageOptions = new ImageSaveOptions(SaveFormat.Png)
{
PaperColor = Color.White,
Resolution = 300,
ImageColorMode = ImageColorMode.None,
PixelFormat = ImagePixelFormat.Format24BppRgb,
};
for (int pageIndex = 0; pageIndex < document.PageCount; pageIndex++)
{
imageOptions.PageIndex = pageIndex;
document.Save(String.Format(@“C:\test\test{0}.png”, pageIndex), imageOptions);
}
// Pdf
document.Save(@“C:\test\test.pdf”, SaveFormat.Pdf);
Note that the image is correctly displayed when the mhtml is opened in Internet Explorer.
Thanks in advance and best regards,
Christophe PETIOT