Free Support Forum - aspose.com

Table's Text is Truncated after MHTML to PDF Conversion using .NET

Hi team.
I’ve used your sample code for convert msg to pdf.
But with some email. i have 2 issue.

Please see my msg file and output pdf file i’ve attached in attachment.
image.png (2.2 KB)

image.png (352.1 KB)

example mail.7z (736.7 KB)

The same problem also appeared in
MSG Converter — Convert MSG to PDF (aspose.app)
Please use the file “Festool pletskud til spotpris.msg” to do the conversion

@ducanh,
Welcome to our community! Thank you for the issue description. I reproduced the problem and got the same result. Could you please clarify what programming language you used?

Yes. I use .net 4.8 and .net core to do this.
Sample code:

var message = MailMessage.Load(msgPath);
var outStream = new MemoryStream();
using (var stream = new MemoryStream())
{
    message.Save(stream, SaveOptions.DefaultMhtml);
    var word = new Document(stream);
    var pdfSaveOptions = new PdfSaveOptions
    {
        Compliance = PdfCompliance.PdfA1a
    };
    word.Save(outStream, pdfSaveOptions);
}

image.jpg (122.1 KB)

Margin issue

@ducanh,
I logged the issue with ID EMAILNET-40259 in our tracking system. Our development team will investigate this case. I will inform you of any progress.

@ducanh,
Our development team investigated the issue.

1. The edges in the output PDF file are cropped.
This is not a bug of Aspose.Email, but a problem of Aspose.Words. If you open the original MSG file in Outlook and save it as MHT, you can use that MHT file to convert to PDF file using Aspose.Words. The resulting PDF document will be similar as after Aspose.Email (with cropped edges).

2. The button captions are different in the source MSG file and output MHT file created by Aspose.Email.
This is because the HTML body of the message contains MSO (Microsoft Office) tags that store the button captions that are visible in Outlook. We have no plans to support this technology in Aspose.Email.

I am moving this thread to Aspose.Words forum where the support team will continue to help you with the first problem.

@ducanh

We have tested the scenario and managed to reproduce the same issue at our side. For the sake of correction, we have logged this problem in our issue tracking system as WORDSNET-22377. You will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.