Show thumbnail of an OPC file

Home Forums Open Packaging Conventions Show thumbnail of an OPC file


This topic contains 6 replies, has 2 voices, and was last updated by  Eric White 1 year, 11 months ago.

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
  • #3279



    I have an OPC-file. It works fine. Now I’m trying to add thumbnail, so when this file is shown in Windows Explorer or, for example, as attachment in browser, my thumbnail is displayed.

    I tried to add
    <Relationship Type="" Target="/thumbnail.png" Id="RTN1" />
    to .rels file. I tried jpeg too. I tried 32×32 and 64×64 sizes.

    <Default Extension="png" ContentType="image/png" />
    or <Default Extension="jpeg" ContentType="image/jpeg" />

    Structure of my file:
    – _rels
    – – .rels
    – thumbnail.png
    – other files
    – [Content_Types].xml

    • This topic was modified 1 year, 11 months ago by  Chiz. Reason: formatting
    • This topic was modified 1 year, 11 months ago by  Chiz.

    Eric White

    I’m afraid this is something that I have no experience with.

    Here is how I would solve this – get a DOCX that has no custom thumbnail, then copy it, add a custom thumbnail to the copy, then use the Open XML SDK Productivity Tool to compare the two. You should be able to identify each and every precise modification that you need in order to create a custom thumbnail.

    I found an interesting thread here:



    Thank you, Eric, for your answer. I will try your idea with DOCX and Productivity Tool.



    I made it work only if I put xps as file extension. If I put my own ext – it shows associated app’s icon. If I put ext, which is not associated with an app – white file icon.


    Eric White

    At this point, I have no further information. I have never read the standard on putting icons on a document – don’t recall that this is in the standard, although it very may well be. Do you know for certain that this is possible?



    I’ve made some more research and it appeared that to draw proper image you need to associate your file extension with proper dll (which will draw thumbnail) via registry. This is described well in IThumbnailProvider Re-Visited. Showing Thumbnail has nothing to do with OPC standard.


    Eric White

    Good to know, thanks.

Viewing 7 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic.