Previously, I’ve mentioned how the Document Conversion Service doesn’t extract images and about how you have to insert them as linked objects. Well, it turns out that there are easier ways to link objects in than I’d explained previously.
In this example, I’m going to insert an image into my document first as an embedded object, then as a linked object. The image itself has been uploaded to an images Library.
The image itself has to be in a library or on a webserver so that the converted page can refer to it by a URL.
In Word 2007 I go to the Insert Picture button:
This opens a file selection dialog. I entered the URL to my images library, and got the following view:
I’m sure that there is a way to add things like the images library to the ‘My SharePoint Sites’ section of the dialog, but I don’t know how to do that off the top of my head. Anyway, I did a normal insert of the image into my document:
Fine. I saved it, checked it in, and converted it. The result I got was:
No image – which is what we expected with embedded images. So next I repeated the process, but this time on the save dialog instead of just hitting Insert, I chose Link to File :
I saved this, checked it in, converted it, and got the output of:
Fantastic! The image is still being referred to after conversion. Now, who happens if I download a copy of the source document, and try and open it up offline. Say I’m a salesman on the road or something, what would I see?
Ah. The document itself has no image. Damn. Okay, lets try again, but this time choose the Insert and Link option:
Saved, converted, etc., and I get a working page:
And now if I open up the document offline I see:
Hurrah! A working document and a working page after conversion. It’s just a pain that it’s more complex that users are used to – they will make mistakes. It’s a real shame that the document conversion service can’t extract the images and put them into an images library for you.
(Side note – this was me at a friends party trying to use helium balloons to float a beer can. It took a surprising number of balloons)
“It’s a real shame that the document conversion service can’t extract the images and put them into an images library for you.”
Our solution was to create our own converter that did the extraction of embedded images and then chained to the built in converter. It worked quite well.
Yeah, that’s what we figured we’d do – it just doesn’t feel right that we have to! 🙂
Still, an interesting technical exercise.
Do you have an example of the document conversion with image extraction. I looked at the ISPConversionProcessor interface but there were no instructions on how to attach it to the converter, etc.
And totally agree that the capability should have been part of the product.
Thanks in advance,
Jake
No, sorry, I wasn’t asked to in the end, so I never did it. I kept getting asked about it, but nobody every wanted to pay for the development time.