Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mathematica 8 Windows EMF/WMF export with transparent background?

182 views
Skip to first unread message

Luci Ellis

unread,
May 21, 2011, 6:45:56 AM5/21/11
to
Dear all
I'm developing a custom plotting function for my employer,
incorporating all the little tweaks and standard formats they want. So
far, so good. But they want to export WMF or EMF graphics into
PowerPoint presentations that (for technical reasons to do with the
screen in the Board room) have dark backgrounds. So they want the
graphics to have transparent backgrounds. But the backgrounds of
graphics exported as WMF/EMF have white backgrounds, even though the
default for Export is meant to be Background->None.
Does anyone have any suggestions about how to enforce the transparent
background? I am having difficulties testing this myself because I'm
developing on a Mac (thus no WMF/EMF export capability), and at the
moment they haven't upgraded their Windows versions from 7.0.
Kind regards
Luci


Armand Tamzarian

unread,
May 22, 2011, 6:58:38 AM5/22/11
to


I have a Mac also, so cannot test WMF but the following formats worked
ok for me: i.e. from a coloured background notebook I saved plots and
imported them as transparent backgrounds into a blue background power
point slide: PDF, PNG, TIFF etc.

Note that a problem you may encounter with exporting a transparent
background is the effect that antialiasing has. With GIF you can set
"TransparentColor" -> GrayLevel[1] but on my system GIF gives a poor
quality result. Plot numbers are still antialiased so you see a white
"cloud" around the numbers.

tmp = Style[Plot[Sin[x], {x, 0, 6 Pi}, Background -> None],
Antialiasing -> False]

Export["test.pdf", tmp, Background -> None]

PDF is probably a good option if you can convince them to import that
format.

Mike


Hans Michel

unread,
May 22, 2011, 6:55:35 AM5/22/11
to
Luci:

Mathematica 7.0 will Export "WMF" and "EMF". But Background -> None, or
Transparent or GrayLevel[0,0] does not remove the background when exported
to "EMF" or "WMF" so there is no reason not to explore now.

Export["D:\\akk\\ee.emf",
Show[Plot[Sin[x], {x, 0, 2 Pi}], {Background -> None}], "EMF"]

Any Ideas put forward would be too cumbersome.
The inkling of the idea I would try is SVG to VML. VML can be embedded in
PowerPoint file, as when slides are saved to HTML VML output is generated as
well as image files.

SVG -> VML Route:
http://vitali.web.cs.unibo.it/Progetti/VectorConverter

http://www.codeproject.com/KB/XML/ooxml_is_defective.aspx?msg=2523751

http://msdn.microsoft.com/en-us/library/bb250524(VS.85).aspx

http://www.w3.org/TR/NOTE-VML

http://www.causeway.co.uk/demos/vml/index.htm

http://www.grapl.com/download/

http://www.garybeene.com/vml/vml-sites.htm

SVG -> WMF Route:
http://inkscape.org/
Mathematica -> SVG -> WMF

DXF Route:
Microsoft Office 97 Supported a DXF filter but it has been removed in
current versions.

Hans

Luci Ellis

unread,
May 23, 2011, 6:24:51 AM5/23/11
to
On 2011-05-22 20:55:35 +1000, Hans Michel said:

Thanks Hans,

> Luci:
>
> Mathematica 7.0 will Export "WMF" and "EMF". But Background -> None, or
> Transparent or GrayLevel[0,0] does not remove the background when exported
> to "EMF" or "WMF" so there is no reason not to explore now.
>
> Export["D:\\akk\\ee.emf",
> Show[Plot[Sin[x], {x, 0, 2 Pi}], {Background -> None}], "EMF"]
>
>

> DXF Route:
> Microsoft Office 97 Supported a DXF filter but it has been removed in
> current versions.
>

The SVG idea is an interesting one but given the institution and
environment, I don't think this will work for this project. Essentially
30-40 or so graphs need to be included in a PowerPoint in the early
morning before the presentation, because of data updates. The people
who do the update are not IT people, but personal assistants and other
administrative people.

Kind regards
Luci


Luci Ellis

unread,
May 23, 2011, 6:28:26 AM5/23/11
to
On 2011-05-22 20:58:38 +1000, Armand Tamzarian said:

> On May 21, 8:45 pm, Luci Ellis <l...@verbeia.com> wrote:
>> Dear all
>> I'm developing a custom plotting function for my employer,
>> incorporating all the little tweaks and standard formats they want. So
>> far, so good. But they want to export WMF or EMF graphics into
>> PowerPoint presentations that (for technical reasons to do with the
>> screen in the Board room) have dark backgrounds. So they want the
>> graphics to have transparent backgrounds. But the backgrounds of
>> graphics exported as WMF/EMF have white backgrounds, even though the
>> default for Export is meant to be Background->None.
>> Does anyone have any suggestions about how to enforce the transparent
>> background? I am having difficulties testing this myself because I'm
>> developing on a Mac (thus no WMF/EMF export capability), and at the
>> moment they haven't upgraded their Windows versions from 7.0.
>> Kind regards
>> Luci

> <snip>


>
> tmp = Style[Plot[Sin[x], {x, 0, 6 Pi}, Background -> None],
> Antialiasing -> False]
>
> Export["test.pdf", tmp, Background -> None]
>
> PDF is probably a good option if you can convince them to import that
> format.

The question is how that goes in PowerPoint 2007 for Windows. If the
machine connected to the Board room projector were a Mac, PDF would
work.

Does anyone with a Windows version of Mathematica 8.0.1 have
time/inclination to see what WMF/EMF export looks like with and without
the Background->None option to Export[]?

Kind regards
Luci


0 new messages