GNOME Bugzilla – Bug 521178
cairo_show_page() is ignored.
Last modified: 2008-04-01 20:51:26 UTC
Please describe the problem: When printing on win32, cairo_show_page() does not start a new page. As I understand it[1], this is already resolved in recent Cairo and this issue will go away once GTK+ starts using cairo_win32_printing_surface. [1] http://gitweb.freedesktop.org/?p=cairo;a=blob;h=70f6220655aed248e0aa9fca2d63753c8644675f;hb=b52f127c12fd7ee2b4f532954cb1e9e4eb8561b4;f=src/cairo-win32-printing-surface.c#l1462 Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
The cairo win32_printing_surface does not call the win32 API to start a new page when cairo_show_page() is called. See this bug for further details: https://bugs.freedesktop.org/show_bug.cgi?id=13344
(In reply to comment #1) > See this bug for further details: > > https://bugs.freedesktop.org/show_bug.cgi?id=13344 Quoted: "...the application needs to call the StartDoc, EndDoc, StartPage, and EndPage functions." I guess that GtkPrint wraps these calls around the "draw-page" signal from GtkPrintOperation. The problem for us is that this API (of printing one single specific page) is a bad fit to tie to our large body of legacy code, which spits out one continuous stream of lines to be printed. That is, we have no way to return from the function that provides the content before all content is delivered, nor can we start in the middle of it. We monitor the filling of the page and need a way to start a new page once it is full. The output can consist of hundreds of pages, occasionally. Once meta surfaces become available in a stable branch of Cairo, we plan to cache the stream of output in an array of meta surfaces (one for each page), and then we can use the existing API by re-playing the meta surface for the requested page. Until then we will work around this by rendering to PDF and have a PDF reader take care of the actual printing. I have not checked, but does not the Linux backend render to PDF and then print that? In that case, show_page() probably works under Linux but not under win32, which is a confusing inconsistency. This may be a relevant thread: http://lists.freedesktop.org/archives/cairo/2006-January/006223.html
Committed a fix for this as part of bug #488833