Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #2736

General PDF/EMF export problems and solutons

From Alexey Popkov <lehin.p@gmail.com>
Newsgroups comp.soft-sys.math.mathematica
Subject General PDF/EMF export problems and solutons
Date 2011-05-26 10:36 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <irlafs$dv4$1@smc.vnet.net> (permalink)

Show all headers | View raw


Good day,

I wish to share a couple of Export-related observations that I feel
could potentially be very useful for others. Anyway I would have saved
a lot of time if I knew it all before...

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:

http://groups.google.com/group/comp.soft-sys.math.mathematica/msg/7f5cb9e2d4677855

The "Printout" environment differs very deeply from the "Working"
style environment. First of all, it sets Magnification to 80%.
Secondly, it uses its own values for the font sizes of different
styles and it results in inconsistent font size changes in the
generated PDF file as compared with the original on-screen
representation.

But happily all these problems 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:

http://groups.google.com/group/comp.soft-sys.math.mathematica/msg/443befb422e4e25a

The quality of the generated EMF file can easily be enhanced by
Magnifying the original graphical object so that exactness of sampling
of the original graphics becomes much more precise. Compare two files:

graphics1 = Style["a", FontFamily -> "Times"];
graphics2 = Magnify[graphics1, 10];
Export["C:\\test1.emf",
 First@ImportString[ExportString[graphics1, "PDF"], "PDF"]]
Export["C:\\test2.emf",
 First@ImportString[ExportString[graphics2, "PDF"], "PDF"]]

If you insert these files into Microsoft Word and zoom in you will see
that the first "a" has sawtooth on it while the second has not.

Back to comp.soft-sys.math.mathematica | Previous | NextNext in thread | Find similar | Unroll thread


Thread

General PDF/EMF export problems and solutons Alexey Popkov <lehin.p@gmail.com> - 2011-05-26 10:36 +0000
  Re: General PDF/EMF export problems and solutons Alexey Popkov <lehin.p@gmail.com> - 2011-05-26 11:47 +0000

csiph-web