Sometimes I have the misfortune of having to write conference papers in Microsoft Word, instead of a more civilised environment like LaTeX. Usefully, Word will refuse to import any kind of vector image format except for their own proprietary and crippled format, WMF/EMF. So, when it comes to diagrams, most people tend to throw their arms up and resort to bitmap formats like PNG. This, however, makes for large file sizes, or fuzzy printouts, so it’s a sub-optimal solution.
Although there are plenty of hoops to jump through, it is however possible to generate reasonable EMF files from other vector formats, which Word will accept. There are a large number of pitfalls, not least because of poor standards-adhesion when it comes to rendering of said formats. Mac OS X’s PDF renderer is no exception, unfortunately, so frequently one will have to resort to various bizarre conversion pipelines to have something readable at the other end.
That said, sometimes it works.
So, this is the procedure I’ve been following, to generate EMF figures from artwork created in a variety of applications, including XFig (which I personally don’t use, but my PhD supervisor Carlo enjoys), Inkscape, and OmniGraffle.
- Install pstoedit, a tool which will take a variety of formats (PDF/EPS, for example) and convert them to another – EMF, in particular.
- This can be accomplished via Fink, for example, or DarwinPorts.
- Make sure the installed version supports EMF output – in Terminal, pstoedit -help | grep emf. If it doesn’t, you’ll need to find an other version elsewhere.
- If your diagram isn’t already in PDF or EPS format already, export it to one or the other.
- Try converting the PDF/EPS, as-is, as a first step. Some commands to try (open in Word/Powerpoint to see the result each time):
- pstoedit -f emf diagram.pdf/eps output.emf
- pstoedit -f emf -pta diagram.pdf/eps output.emf (Place letters individually, if text looks odd)
- pstoedit -f "emf:-m" diagram.pdf/eps output.emf (Use Arial as font, if font looks wrong)
- pstoedit -f emf -drawbb diagram.pdf/eps output.emf (Force drawing of bounding box – try this if you get cropping)
- pstoedit -f emf -xscale 2 -yscale 2 diagram.pdf/eps output.emf (Scale up – use this if lines look blocky; experiment with larger values than 2)
- pstoedit -f "emf:-m" -pta -drawbb diagram.pdf/eps output.emf (A combination of some of above)
- If your EMF version looks wrong, try exporting to EPS if you were using PDF, or PDF if you were using EPS – different renderers perform differently. Try above steps again on this new exported version.
- If this still doesn’t produce reasonable output, you’ll want to try another application that exports better-behaved PDF/EPS. You’ll need to import your diagram into such an application, make any cosmetic changes required to counteract any funny business as a result of the import, then export as PDF/EPS.
- For a while, I was using Inkscape for this purpose, but I was still getting funny output sometimes.
- I discovered a native OS X application called Intaglio, which seems to produce very good PDF output (not so much with EPS).
- For either application, export your diagram in a format they can understand, to subsequently import.
- Inkscape will basically only take SVG, from what I can remember. You can try converting the PDF/EPS to SVG using pstoedit again: pstoedit -f svg diagram.pdf/eps output.svg
- Intaglio will happily take PDF and let you convert it to an editable format, which will work some of the time, with a reasonably well-behaved PDF. Drag the PDF onto the canvas, select it, then use Object, Convert, PDF for Editing.
- Fix any visual problems caused by the import, using the application’s editing tools.
- Export your diagram in PDF/EPS (try both, if necessary)
- Intaglio seems to work best with PDF: Select the figure, then File, Save Selection As, select PDF and Crop to Content Size.
- Once you’ve exported PDF/EPS, repeat step 4 to try to generate reasonable output.
The whole process is undoubtedly an ordeal, and requires serious dedication, but it would appear to be required if you want to generate vector graphics in a Word document. Lets hope the geniuses at Microsoft remember to add a PDF/etc importer into their next Office.
I was looking for this, and found this page, plus the easier way to do it:
http://www.pstoedit.net/pstoedit/
provides an installer for a Word plugin that lets you import PostScript pictures directly into Word.
Yes, that’s the pstoedit tool – and it works very well, but only if the original PDF/EPS is well formed. Unfortunately, many tools generate PDF that pstoedit struggles on (OS X’s PDF generator included) – hence my usage of Intaglio to generate better-formed PDF, when I then pass to pstoedit.
The Word plugin simply runs the conversion to EMF step internally, and does the same thing as on the command line – one still needs PDF/EPS that it can parse correctly, alas.
Great howto, thanks. BTW, if you are struggling with ill-formed PS, pstops will often help to clean it up.
I have found that if you are having rendering issues due to MS not translating the vector well, enlarge your vector image artboard (sorry Illustrator Jargon) to 10 times what you need. Then save as emf. The result will generate much cleaner vectors at smaller sizes.
Peace,
TW
Oops, I forgot….
Increase your art by ten times too!!
It seems to me that Adobe Acrobat has added an Insert Object – Adobe PDF to my Word 2003. And it actually works, for the most part.
Problem is with printing / saving that Word .doc to PDF format again. The vector graphic from the inserted PDF object is then transformed into low resolution pixel image.
About the PSToEdit tool, I read there’s a plugin for Better EMF, is this worth buying?
So, I am running a very old version of .ai (illustrator 8.0, circa 1998 believe it or not) and MS Professional Plus 2010. Windows XP v5.1 Dell platform. The reasons why I am running such an old vsn of .ai are too long to get into here…. I am getting complaints about the same thing….poor JPGs in MS word , then output to PDF. The ending results are crap. Why can’t I use a vector format he says? Well, they still are not compatible.
The solutions here are complicated (to me) and seem to be for a UNIX or mac platform.
Can you suggest other ideas?
THX,
Paula
Actually, a trial we did seems to have worked…..
.ai file => .eps, then inserted to MS Word. Looks lousy on screen, prints beautifully. Even as a PDF.