General PDF/EMF export problems and solutions
1) It is completely unexpected and undocumented, but Mathematica exports and saves graphics in PDF and EPS formats using a set of style definitions that differs from the one used for displaying Notebooks on screen. By default Notebooks are displayed on screen in the "Working" style environment (which is default value for the ScreenStyleEvironment
global $FrontEnd
option) but are printed in the "Printout"
style environment (which is default value for the PrintingStyleEnvironment
global $FrontEnd
option). When one exports graphics in raster formats such as GIF and PNG or in EMF format Mathematica generates graphics that looks exactly like it looks inside Notebook. It seems that the "Working"
style environment is used for rendering in this case. But it is not the case when you export/save anything in PDF or EPS formats! In this case the "Printout" style environment is used by default that differs very deeply from the "Working" style environment. First of all, the "Printout" style environment sets Magnification to 80%. Secondly, it uses its own values for the font sizes of different styles and this results in inconsistent font size changes in the genarated PDF file as compared with the original on-screen representation. The latter can be called FontSize fluctuations which are very annoying.
But happily this can be avoided by setting the PrintingStyleEnvironment global $FrontEnd option to "Working":
SetOptions[$FrontEnd, PrintingStyleEnvironment -> "Working"]
2) The common problem with exporting to EMF format is that most of programs (not only Mathematica) generate a file that looks nice at the default size but becomes ugly when you zoom it in. It is because metafiles are sampled at screen resolution fidelity. The quality of the generated EMF file can be enhanced by Magnify
ing the original graphical object so that exactness of sampling of the original graphics becomes much more precise. Compare two files:
graphics1 =
First@ImportString[
ExportString[Style["a", FontFamily -> "Times"], "PDF"], "PDF"];
graphics2 = Magnify[graphics1, 10];
Export["C:\\test1.emf", graphics1]
Export["C:\\test2.emf", graphics2]
If you insert these files into Microsoft Word and zoom them in you will see that the first "a" has sawtooth on it while the second has not (tested with Mathematica 6).
Another way through ImageResolution
was suggested by Chris Degnen (this option has effect at least starting from Mathematica 8):
Export["C:\\test1.emf", graphics1]
Export["C:\\test2.emf", graphics1, ImageResolution -> 300]
3) In Mathematica we have three ways to convert graphics into metafile: via Export
to "EMF"
(strongly recommended way: produces metafile with highest possible quality), via Save selection As...
menu item (produces much lesser precise figure, not recommended) and via Edit ► Copy As ► Metafile
menu item (I strongly recommend against this route).