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="http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail" 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" />
<Default Extension="jpeg" ContentType="image/jpeg" />
Structure of my file:
– – .rels
– other files
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.
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.
Good to know, thanks.
You must be logged in to reply to this topic.