[cairo] Trying to export an EMF file.

Zoltán Turányi teknos at gmail.com
Wed Jun 9 02:36:47 PDT 2010

Hi Bryan,

I work with cairo using EMF and my experience is that you get a bitmap in
the EMF if you use cairo functions not supported
by GDI (or EMF). These include gradients and transparency. You can set the
resolution of the image cairo uses with
cairo_surface_set_fallback_resolution. If you want to insert a bitmap, EMF
can only store it in an uncompressed format,
so I see no way around that being exploded in size.

I am sure I do not get your problem fully, so my suggestions above are
probably off-target.


2010/6/8 Bryan Montgomery <monty at english.net>

> Hello,
> I've been trying to find a process today to generate an image to EMF
> (Windows Enhanced MetaFile). I'm able to use the Java HEP package to create
> an EMF - however that seems to just embed the bitmap and you end up with a
> 2MB file as opposed to the attached SVG file.
> Searching google, I came across this thread -
> http://old.nabble.com/Fwd:--SVG-to-EMF-quality-p25867395.html.
> I've tried compiling the code in the thread to accomplish this, but I am
> left with an unsatisifed link error for the draw function. It's been a long
> time since I worked with MSVC!
> I was wondering if anyone has code that I could compile (or possibly
> execute) on Windows - and whether this will produce an EMF file of a similar
> size to the SVG file ( HEP also produces similar sized pdf and eps files -
> just not emf) - or if it will also balloon to 2MB.
> Thanks,
> Bryan.
>     /* Undo the scale applied to the GDI CTM */
>     cairo_scale (cr, 16, 16);
>     draw (cr);
>     cairo_destroy (cr);
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.cairographics.org/archives/cairo/attachments/20100609/d9724272/attachment.htm>

More information about the cairo mailing list