[cairo] Blurry page when printing pdf on windows

Juan Garcia j.garcia at m-privacy.de
Fri Jun 10 13:39:50 UTC 2016

Hi everybody!

First of all, thank you very much for creating such an awesome library!

I've encountered a small problem while using it and would really
appreciate if you could give me a hand with it. If you find the time and
feel like it, of course!

I created the following pdf
with firefox:

(password is 'save')

With some copy paste from different sources (mostly examples from your
page and poppler) I managed to implement a small cairo_pdfprinter.exe to
print pdfs with windows (I actually use the code somewhere else but I
created it to test and the code I am using elsewhere is exactly the same).

Please find the source here (cairo_pdfprinter.c):

(password is also 'save')

It probably has to do with
cairo_surface_t* surface = cairo_win32_printing_surface_create

in the do_print function.

Most of the time it works, but with some pdfs created with certain web
pages with firefox it prints some of the pages blurred (normally not all
of them). The pdf is ok. See the attached xps which I printed with the
standard windows printer (this also happens with actual printers).

Here the blurry xps example:
(password is also 'save')

In the example, just the first page that appears blurry. I believe it
somehow might have to do with alpha channels and was very excited when I
saw there was a new version that seems to solve *exactly* my problem :)

Unfortunately, after compiling the newest cairo (1.15.2), and
recompiling the example I get an error which says:

Assertion failed!

Program: Z:\cairo_pdfprinter.exe
File: cairo-recording-surface.c, Line 599

Expression: ! surface->unbounded

If I happen to *not* print the first page, the file *does* print.

Am I doing something wrong here? Do you have any idea what could be wrong?

Once again, thanks for the cool software and thank you very much for
your help!

Kind regards,

More information about the cairo mailing list