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

Free Support Forum - aspose.com

Formating issues on email body to PDF conversion (using html)

Hi, we are upgrading our software from Aspose.Total 18.8 to 19.8 and found some formating issues that where working to our satisfaction in 18.8 but are not acceptable to our customers in 19.8.

The attached files demonstrate this, the message is Autoschade has an extra empty line on the first page and therefore the rest of the message is broken appart. Part of the adres is moved to the next page.

I included the pdf that 18.8 generated als wel the PDF that 19.8 is generating, also the original message and the PDF that Outlook would print.

The code we use is:

Aspose.Email.License license = new Aspose.Email.License();
license.SetLicense(@"Q:\Install\Ontwikkeling\Componenten\Aspose Total for .NET\Aspose.Total.lic");

MailMessage theMessage = MailMessage.Load(@"D:\Temp\Aspose\Original.msg");

foreach (Attachment attachment in theMessage.Attachments)
{
    string filename = string.Join("_", attachment.Name.Split(Path.GetInvalidFileNameChars()));

    if (attachment.ContentType.MediaType.Equals("message/rfc822", StringComparison.OrdinalIgnoreCase))
    {
        if (!Path.GetExtension(filename).Equals(".msg", StringComparison.OrdinalIgnoreCase))
        {
            filename += ".msg";
        }
    }

    filename = Path.Combine(@"D:\Temp\Aspose\Output", filename);

    if (attachment.ContentType.MediaType.Equals("message/rfc822", StringComparison.OrdinalIgnoreCase))
    {
        MemoryStream ms = new MemoryStream();
        attachment.Save(ms);
        MailMessage attMsg = MailMessage.Load(ms);

        SaveOptions options = new MsgSaveOptions(MailMessageSaveType.OutlookMessageFormatUnicode);
        attMsg.Save(filename, options);
    }
    else
    {
        attachment.Save(filename);
    }
}

Autoschade.zip (368.6 KB)

@andreas4e47b,

I have observed your comments. Can you please share intermediate HTML file that is generated using Aspose.Email so that we may further investigate to help you out.

Here are the mhtml files generated by 18.8 and 19.8.

mhtmls.zip (42.5 KB)

I dit some more tests and this seems to be happening sinds Apsose.EMail 19.8. When I downgrade my project to the 19.7 the output is like in 18.8.

@andreas4e47b,

I like to inform that we have created an issue with ID EMAILNET-39586 in our issue tracking system to investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once issue will be fixed.

The issues you have found earlier (filed as EMAILNET-39586) have been fixed in this update.