Re: Printing a second page from the canvas
- From: Murray Cumming <murrayc murrayc com>
- To: Damon Chaplin <damon karuna eclipse co uk>
- Cc: goocanvas <goocanvas-list gnome org>, davidk <davidk openismus com>
- Subject: Re: Printing a second page from the canvas
- Date: Thu, 06 Oct 2011 16:07:29 +0200
On Thu, 2011-10-06 at 10:32 +0100, Damon Chaplin wrote:
> On Thu, 2011-10-06 at 09:05 +0200, Murray Cumming wrote:
> > I'm using goo_canvas_render() in a GtkPrintOperation::draw-page handler,
> > but maybe I misunderstand the meaning of goo_canvas_render()'s bounds
> > parameter.
> >
> > In this simple test case, the first page is fine, but the second page is
> > always blank, as you can see in the print preview.
> > https://bugzilla.gnome.org/show_bug.cgi?id=660553#c5
>
> I think you just need to translate the output to the position you want
> it on the page, e.g.:
>
> In draw_page():
> cr = gtk_print_context_get_cairo_context(context);
> + cairo_translate (cr, 0, -A4_PAGE_HEIGHT * page_nr);
> goo_canvas_render(GOO_CANVAS(data->canvas), cr, &bounds, 0.0);
>
> That seems to work here.
>
> We should add some documentation for this.
Thanks. That works. I was doing the cairo_translate() after
goo_canvas_render(), not before.
I'll add something to the documentation. Maybe we can even add this test
case as an example in git.
--
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]