Email to PDF Issue data trunctaion

I am converting .msg files to PDF, and facing issue of data truncation on left and right margins,

in converted pdf Email right and left margins data got truncated , please provide solution for the same

Thanks

@tony_wang_mcmcg_com,

Please share a sample input MSG file, output file and a sample document demonstrating how output should look. We will evaluate it and update you about our findings.

I am sending email file in email forums@asposeptyltd.com

@tony_wang_mcmcg_com,

You may send us sample files in reply to this post as an attachment. Please use the “Upload” button in the reply box menu bar to upload the ZIP file.

test.zip (38.1 KB)

@tony_wang_mcmcg_com,

We have evaluated the sample MSG file. You can get the desired output using the following code snippet.

CODE:

        string inputfile = @"test_170995.msg";
        string outputFile = @"test_170995_out.pdf";

        Aspose.Email.MailMessage message = Aspose.Email.MailMessage.Load(inputfile);
        message.TimeZoneOffset = TimeZone.CurrentTimeZone.GetUtcOffset(message.Date);
        
        Aspose.Email.MhtSaveOptions mhtSaveOptions = new Aspose.Email.MhtSaveOptions
        {
            MhtFormatOptions = Aspose.Email.MhtFormatOptions.WriteHeader | Aspose.Email.MhtFormatOptions.WriteCompleteEmailAddress
        };
        mhtSaveOptions.SkipInlineImages = false;
        
        System.IO.MemoryStream msgStream = new System.IO.MemoryStream();
        message.Save(msgStream, mhtSaveOptions);
        msgStream.Position = 0;

        Aspose.Words.License _lic = new Aspose.Words.License();
        _lic.SetLicense(@"Aspose.Total.lic");

        var options = new Aspose.Words.LoadOptions()
        {
            LoadFormat = Aspose.Words.LoadFormat.Mhtml
        };
        
        var document = new Aspose.Words.Document(msgStream, options);
        document.FirstSection.PageSetup.Orientation = Aspose.Words.Orientation.Landscape;
        document.Save(outputFile, Aspose.Words.SaveFormat.Pdf);