Extracting pictures from Open Office documents

This is really dull, but I wanted to write it down before I forget. I was given some Word and RTF documents, and wanted to extract a logo image from one of them. I spent ages fiddling around with context menus and such, trying to find the elusive ‘save image’ button, but it wasn't there. I could do a screen dump to get it, or copy and paste it into the drawing program and then save the whole thing to get a slightly scaled version, but neither of these gave me the actual image that was in the document, just reconstructed crufted versions of it.

I just came up with the solution. I remembered discovering that OpenOffice saves its documents in a zip file, containing various XML files. I guessed (it turns out correctly) that the images would be stored as separate files within that, since XML isn't exactly the most efficient format for storing images. So the logo I was after is there for the grabbing.

To extract an image, load your document into Open Office (or ‘OpenOffice.org’ as they seem to want to call it) and save it as an “OpenOffice.org 1.0 Text Document” or equivalent (I expect Star Office's format is exactly the same). Then unpack the zip file (which will have the .sxw extension) into a spare directory (so as not to make a mess), and look in the Pictures directory. Each picture is stored as a separate image file, apparently in the original format (I've seen it save them in PNG and JPEG formats).

< Electronica and Elgar | Deck the halls with fractal crystals >

Miniblog

(nuggets of inanity)

Tuesday Apr 24th 2007, 16:54 »
Just took the annual web design survey that AListApart do. I don't realy consider myself to be a web designer, but I have been doing a lot of HTML and CSS lately.
Monday Apr 23rd 2007, 18:23 »
Strange, there appears to be a bare-knuckle boxing match going on in the field outside my flat. Wish they wouldn't make so much noise about it.
Thursday Mar 1st 2007, 18:47 »
“In its written form, Hebrew has no vowels, making it the ideal language for texting.”
—Said in jest on some Radio 4 programme just now.

Archive: 2007 · 2006 · 2005 · 2004
Feed