none
OpenXML v2.0 and .MHT inside the AltChunk - image styling is ignored. RRS feed

  • Question

  • Hello,

    I found very strange behavior of how image size is resolved inside the MHT embedded to document via AltChunk section. The scenario is the following: html page with images is saved as .MHT file. That mht file is embedded to OpenXML document in AltChunk section. 

    Depending on the size of image inside the HTML and the way the image size is set the resulted image in OpenXML document renders differently. 

     

    Source html page has the following image tag:

    <img width="1584" height="918" style="width: 308px; height: 215px;" alt="" src="/Corporate/screenshot.PNG" complete="complete"/>

    ,where the image size is represented in two places - parameters of the <img> tag and inside the inlined style. This html has been generated by 3rd party WYSIWYG editor, where the large image has been copy-pasted and then size has been decreased. 

    When we open the generated .MHT file in browser we see the small image - it means that size from the inlined style has been applied(width: 308px; height: 215px), however, when we open the resulted openxml document (with .mht inside) we see the *large* image. It means that inline styling size has been ignored and only width="1584" height="918" parameters have been used.

    I wonder why Office 2007/2010 ignores the styling size information for the embedded MHT files? Is it a bug of OpenXML v.2.0?


    SharePoint 2007 - 2010 Tips & Tricks Portal | Microsoft MVP | My Blog about Information Management | My twitter
    Wednesday, June 2, 2010 12:43 PM

Answers

  • Hello Michael,

    Based on my understanding, the problem is why Word ignore the .mht file's some style properties and displays the mht file in an inconsistent way as the web browser. Actually, OpenXML is all about the document format. How Word displays the embedded mht file is related to the Word rendering function. So it looks like a product behavior instead of an issue in OpenXML format or OpenXML SDK. As an result, I would suggest you try the technet Office forum to see if anyone there can share a good idea on this.

    By the way, is it possible to share the document, as well as the mht you are talking about? So that the community will see the problem directly.

    :-)

     

    Best regards,
    Ji Zhou
    MSDN Subscriber Support in Forum


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, June 4, 2010 1:44 PM
    Moderator

All replies

  • Hello Michael,

    Based on my understanding, the problem is why Word ignore the .mht file's some style properties and displays the mht file in an inconsistent way as the web browser. Actually, OpenXML is all about the document format. How Word displays the embedded mht file is related to the Word rendering function. So it looks like a product behavior instead of an issue in OpenXML format or OpenXML SDK. As an result, I would suggest you try the technet Office forum to see if anyone there can share a good idea on this.

    By the way, is it possible to share the document, as well as the mht you are talking about? So that the community will see the problem directly.

    :-)

     

    Best regards,
    Ji Zhou
    MSDN Subscriber Support in Forum


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Friday, June 4, 2010 1:44 PM
    Moderator
  • After detailed investigation we found that it was an issue with Office 2007 without SP2.

    Installing Office SP2 fixed this issue


    SharePoint 2007 - 2010 Tips & Tricks Portal | Microsoft MVP | My Blog about Information Management | My twitter
    Monday, June 7, 2010 12:01 AM