Problems with email (mhtml) rendering

We’re doing a simple save of an mhtml file into a pdf. It looks as if the mhtml file is considered too wide by the renderer so it simply crops out both the sides.

We want to know if there is a setting which can force the full document to fit into the pdf.

var wordOptions = new LoadOptions
{
    LoadFormat = LoadFormat.Mhtml,
    PreserveIncludePictureField = false
};

var doc = new Document(mhtml, wordOptions);

using (var ms = new FileBackedMemoryStream())
{
    doc.Save(ms, SaveFormat.Pdf);
}

This is the code we are using to save the mhtml to a pdf.

Is there a setting that will stop the render cutting off text from both sides?

Hi Shane,

Thanks for your inquiry. Your query pertains to Aspose.Words. I am moving your query to related forum, so my colleague from Aspose.Words will answer you asap.

We are sorry for the inconvenience caused.

Best Regards,

Hi Shane,

Thanks for your inquiry. The shared ‘file.zip’ have size 0kb. Could you please attach your input mhtml again for testing? We will investigate the issue on our side and provide you more information.

Apologies - The zip file I uploaded contained the mhtml file, but it must have been stripped out.

Hi Shane,

Thanks for sharing the document. Please note that Aspose.Words mimics the same behavior as MS Word does. If you convert your mhtml to Pdf using MS Word, you will get the same output.

To workaround this issue, please use following code example. Hope this helps you. Please let us know if you have any more queries.

var wordOptions = new LoadOptions
{
    LoadFormat = LoadFormat.Mhtml,
    PreserveIncludePictureField = false
};
var doc = new Document(MyDir + "file.mhtml", wordOptions);
foreach (Table table in doc.GetChildNodes(NodeType.Table, true))
{
    table.AutoFit(AutoFitBehavior.AutoFitToWindow);
}
doc.Save(MyDir + "Out.pdf");