Re: Gtk Printing and evince



Hi Carlos,

In evince we have the document pages already rendered, so can I take the
pixbuf of the page and create a cairo surface from it and use it in
draw_page signal? I don't know if this is the right way to do it.

Unless rendered at a high resolution, the output will probably look
pretty ugly and be much larger than strictly necessary. Since poppler
has a Cairo rendering backend and the GtkPrintContext pipeline is
built around cairo, it'd probably be better to do something like this
pseudo-code:

cairo_t = gtk_print_context_get_cairo(context)
for page in document.pages:
 poppler_page_render(page, cairo_t)

Best,
Dom
--
Counting bodies like sheep to the rhythm of the war drums.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]