Inserting Images into Word for the Document Conversion Service

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.

Images Library showing source image

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:

Insert Picture Button

This opens a file selection dialog. I entered the URL to my images library, and got the following view:

File Selection from Images Library

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:

Word document with image

Fine. I saved it, checked it in, and converted it. The result I got was:

Converted Page without image

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 :

Inserting a Link to a File

I saved this, checked it in, converted it, and got the output of:

Converted Page with Image

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?

Document Opened offline showing no image

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:

Converted Page with Image

And now if I open up the document offline I see:

Offline Word document showing Linked and Embedded image

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)

Inserting Images into Word for the Document Conversion Service

4 thoughts on “Inserting Images into Word for the Document Conversion Service

  1. Chris Predeek says:

    “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.

  2. Yeah, that’s what we figured we’d do – it just doesn’t feel right that we have to! 🙂

    Still, an interesting technical exercise.

  3. JakeUT says:

    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,

  4. 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.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.