[cairo] postscript backend

Ross McFarland rwmcfa1 at neces.com
Sat Nov 27 06:15:47 PST 2004


On Wed, 2004-11-24 at 16:10, Ricardo Markiewicz wrote:
> hi all ... i'm triying to save to postcript but somethings gone wrong.
> 
> Mi code look like : 
> w = h = 300;
> 
> fp = fopen ("temp.ps", "w");
> cr = cairo_create (cr);
> cairo_set_target_ps (cr, fp, w/96.0f, h/96.0f, 300, 300);
> 
> do_draw();
> 
> cairo_show_page (cr);
> cairo_destroy (cr);
> fclose (fp);
> 
> The PS file is generated "ok", but when i want to see it with Gostview
> or ggv a white paper are show. If i change the paper size (to A4 for
> example), some drawing is show at bottom, because (0,0) in postcript
> is in the lower-left corner .... what i'm doing wrong?

ghostscript has a bug or two that i've encountered (the version on
fedora core 2) that causes blank pages to show in some circumstances.
forcing a redraw or specifying a device (-sDEVICE=x11) seems to fix it.
that kinda sounds like part of the problem you're seeing here. 

as for why things are only showing in the lower left-hand corner i'd
have to see do_draw () to be able to venture a guess there.

-- 
-rm
http://www.neces.com/




More information about the cairo mailing list