Issue Saving Email To Pdf


#1

Cannot save properly the following file to PDF:
https://www.dropbox.com/s/9owfisj9k0pxqns/Great%20deals!.msg?dl=0

This is the output for the operation:
https://www.dropbox.com/s/kew663capo4goyt/Great%20deals!.msg.Pdf?dl=0

As you can see some extraneous html is at the top of the PDF

This is the code to reproduce the problem:

    string filename = @"C:\disco\Great deals!.msg";
    MailMessage eml = MailMessage.Load(filename);
    MemoryStream memoryStream = new MemoryStream();
    eml.Save(memoryStream, SaveOptions.DefaultMhtml);
    var document = new Document(memoryStream, new Aspose.Words.LoadOptions { LoadFormat = LoadFormat.Mhtml });
    document.Save(filename +".Pdf", SaveFormat.Pdf);

#2

@PeteLee,

We were able to reproduce the issue that you reported. We have logged a ticket in our issue tracking system as EMAILNET-39168 to investigate it further. We will update you here as soon as additional information is available.


#3

The issues you have found earlier (filed as EMAILNET-39168) have been fixed in this update. This message was posted using BugNotificationTool from Downloads module by MuzammilKhan


#4

Hello thanks for fixing part of the problem, but we have a variant where we save the Email
as a PDF with no headers and we still have the extraneous HTML included in the PDF in that case.

Please see below a snipped to reproduce the problem

        string filename = @"C:\disco\Great deals!.msg";
        MailMessage eml = MailMessage.Load(filename);
        MemoryStream memoryStream = new MemoryStream();
        **eml.Save(memoryStream, new MhtSaveOptions() {MhtFormatOptions = MhtFormatOptions.None});**
        var document = new Aspose.Words.Document(memoryStream, new Aspose.Words.LoadOptions { LoadFormat = Aspose.Words.LoadFormat.Mhtml });
        document.Save(filename + ".Pdf", Aspose.Words.SaveFormat.Pdf);

#5

@PeteLee,

Thank you for your feedback.
We were able to reproduce the issue that you reported. We have logged the details against the ticket EMAILNET-39168 for further investigation. We will update you here as soon as additional information is available.