Render Problems With MSG

Last post 05-20-2011, 10:22 PM by aske012. 9 replies.
Sort Posts: Previous Next
  •  05-17-2011, 12:09 PM 304061

    Render Problems With MSG

    Attachment: Present (inaccessible)

    We are experiencing some render issues.

    The attached MSG doesn't render correctly. Please see the image attached.

     


    This message was posted using Page2Forum (attachment) from Convert Outlook Message File (msg) to Tiff Image - Aspose.Network for .NET
     
  •  05-17-2011, 3:17 PM 304116 in reply to 304061

    Re: Render Problems With MSG .NET

    Hi,

    Thank you for inquiry.

    Are you using the sample code provided at http://www.aspose.com/documentation/.net-components/aspose.network-for-.net/convert-outlook-message-file-msg-to-tiff-image.html page for MSG to TIFF conversion?

    I checked at my end with the attached MSG file and found out that MSG to MHT shows full message. But, MHT to TIFF cuts some part from the left.

    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
  •  05-18-2011, 8:15 AM 304283 in reply to 304116

    Re: Render Problems With MSG

    Yes,

    I am using that example, and the image export cuts a lot from the left and a bit from the right.

     

    Any Suggestion?

     

    Best Regards.

     
  •  05-18-2011, 1:58 PM 304391 in reply to 304283

    Re: Render Problems With MSG .NET

    Hi,

    I have moved this thread in Aspose.Words forum, as this problem seems to be related to MHT to TIFF conversion. The MSG to MHT is conversion is fine.

    MailMessage msg = MailMessage.Load("Michaels Customer Security Alert.msg", MessageFormat.Msg);
    // convert MSG to MHTML and save to stream
    MemoryStream msgStream = new MemoryStream();
    msg.Save(msgStream, MailMessageSaveType.MHtmlFromat);
    msg.Save("test.mht", MailMessageSaveType.MHtmlFromat);
    msgStream.Position = 0;
    // load the MHTML stream using Aspose.Words for .NET
    Document msgDocument = new Document(msgStream);
    msgDocument.Save("Outlook-Aspose.tif", SaveFormat.Tiff);

    Best Regards,
    Saqib Razzaq
    Support Developer, Aspose Sialkot Team
    http://www.aspose.com
    Your File Format Experts
     
  •  05-18-2011, 8:43 PM 304450 in reply to 304391

    Re: Render Problems With MSG

    Hi Jaime,

    Thanks for your inquiry.

    I managed to reproduce the issue on my side, your request has been linked to the appropriate issue. We will inform you when it's resolved.

    The issue seems to be with the nested tables that are created during import from MHTML into Aspose.Words. If you export the document into Word format such as DOC or DOCX the output looks perfect, however when rendering the output becomes messed up.

    I'm afraid I can't suggest any work around right now, other than providing this document as a read only DOCX instead of a PDF.

    Thanks,


    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  05-19-2011, 4:15 PM 304700 in reply to 304450

    Re: Render Problems With MSG

    Thanx for your reply.  

     

    Didn´t get you there, do you mean export to PDF instead of word? and then export to image_

     

    Best Regards

     
  •  05-19-2011, 6:28 PM 304711 in reply to 304700

    Re: Render Problems With MSG

    Hello,

    Thank you for your inquiry.
    The problem arises only when rendering. This refers to when a document is saved as pdf, xps, tiff etc ... If you save a document in a flow format (doc, docx) it looks as expected.


    Kind regards,

    Viktor Kazmiruk
    Technical Support
    Aspose Auckland Team
     
  •  05-20-2011, 10:38 AM 304913 in reply to 304711

    Re: Render Problems With MSG

    Hi Jaime,

    Upon further invesigation, it appears this issue occurs because the tables are loaded from HTML as having very large width (even larger than the page). When saving to a Word format and opening with Microsoft Word, these tables are automatically sized to the page width by default. However when rendering these stay at the same size and appear outside the page which is why the rendered output looks incorrect.

    You can use the code below as a work around to fix this in the mean time. This code will fit the tables in the document to the width of the page in the same way MS Word does. This makes the output document look much better. You can find the FitTableToPageWidth method in this article here.

    // Fit all tables to the page width.

    foreach (Table table in doc.GetChildNodes(NodeType.Table, true))

    {

        FitTableToPageWidth(table);

    }

     

    // Manually extend the outer table a bit if you want to make sure that the red background comes through.

    Table firstTable = (Table)doc.GetChild(NodeType.Table, 0, true);

    firstTable.FirstRow.FirstCell.CellFormat.Width += 100;

    Thanks,


    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
  •  05-20-2011, 3:19 PM 304967 in reply to 304913

    Re: Render Problems With MSG .NET

    Attachment: Present (inaccessible)

    Thanx for your suggestion, it helped a lot in the rendering quality.

     

    Still have problems with other emails. See the one attached.

     

    Best Regads

    Filed under: email;export;image;render
     
  •  05-20-2011, 10:22 PM 304990 in reply to 304967

    Re: Render Problems With MSG

    Hi Jaime,

    Thanks for your inquiry.

    I think you can use the same code as above to improve the output. However the Dell message does look quite different when rendered. It is difficult to always faithfully reproduce the exact same output from HTML based sources. We will hopefully try improve this in future versions.

    I'm afraid for now I cannot suggest any workaround for now.

    Thanks,


    Adam Skelton
    Programming Writer
    Aspose Auckland Team
     
View as RSS news feed in XML