[cairo] SVG & PS/EPS surfaces

Tomas By tomas at basun.net
Sun Aug 2 11:15:14 PDT 2015

Hi all,

In C it works fine. I create a recording surface and an EPS surface as 

| rs = cairo_recording_surface_create(CAIRO_CONTENT_COLOR,NULL);
| cr = cairo_create(rs);
   (drawing commands on cr)
| fs = cairo_ps_surface_create("test.eps",100.0,100.0);
| cairo_ps_surface_set_eps(fs,1);
| crout = cairo_create(fs);
| cairo_set_source_surface(crout,rs,0,0);
| cairo_paint(crout);
| cairo_destroy(cr);
| cairo_destroy(crout);
| cairo_surface_finish(fs);

The resulting EPS file is very nicely vectorised.

It is somewhat annoying to have to use C, though.

Is there any other/simpler/better way to do this?


More information about the cairo mailing list