Re: [R] Lattice + Word: Changing .wmf files to .pdf files

From: Soukup, Mat <>
Date: Thu, 05 Jun 2008 09:56:54 -0400

Hi All,

I'm by no means an expert on anything related to M$ products... However I was recently forced (reluctantly at that) to put together a PPT presentation which included multiple R graphics. So I thought I'd share what I found to produce decent looking graphics.

I created all the graphics from R as PDF files making sure to size them accordingly by using the height and width arguments in the pdf function. I would then open the graphics with Acrobat Professional and use the snapshot tool (camera icon) to copy the image. This image was then easily pasted into PPT (or Word in your case) which looked quite well. At least this seemed to work out all right on my Windows XP PC.

Hope this helps,


-----Original Message-----
From: [] On Behalf Of Mike Prager
Sent: Thursday, June 05, 2008 9:38 AM
Subject: Re: [R] Lattice + Word: Changing .wmf files to .pdf files

Jim Price <> wrote:

> [...]
> Currently we are using windows metafile format for in-text tables for
> reports created in Word. However, we've discovered some artifactual
> being created in our final output once the Word document is changed to
> The process is as follows:
> [...]
> If any one can shed enlightenment (or suggest an alternative approach
> preserves decent fidelity - we've struggled with postscript files in
> past, but this may be our opportunity to try them out again), it would
> much appreciated.

The best approach depends on how much you care about the Word files looking their best before conversion, vs. caring most about the PDF.

If you care most about the PDF, you can save your graphics as EPS files from R (either by using the postscript device or the savePlot function with type = "eps"). I tried one EPS file, and found that Word 2007 imported EPS better than some older versions. When I converted to PDF, the graphic was sharp and clear. The downside of this approach is that before the conversion Word displays the EPS graphic as a rough bitmapped preview -- quite workable, but not suitable for final version.

If you want both Word and PDF versions to look good, there is no perfect solution. You could try generating the graphics as PNG, which will look good (but not great) in both places. That approach will likely increase file sizes considerably.

Hope that helps.

Mike Prager, NOAA, Beaufort, NC
* Opinions expressed are personal and not represented otherwise.
* Any use of tradenames does not constitute a NOAA endorsement.

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 05 Jun 2008 - 15:49:30 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 05 Jun 2008 - 18:30:40 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive