[cairo] a question of cairo printer

David Björkevik david at bjorkevik.se
Wed Oct 14 08:36:50 PDT 2009

Liang Wang wrote:
> Hello, I am a software  engineer in china. We are developing a new
> product, but we experiencing a problem. When we use cairo
> transparency effect to draw graphics on text or graphics drawed by
> gdi, after printing, we found the effect of transparency is enable.
> The graphics drawed by cairo will cover the graphic drawed by gdi.
> But when we use that on a graphic drawed by cairo, after printing, it
> is correct. So, I wanna know why and how to resolve  this problem.

You shouldn't mix cairo and non-cairo drawing operations on a printer
device context. Transparency will not work.

You have two options:
1. Rewrite your program to use cairo exclusively
2. Draw to a bitmap device context before printing. You should be able
to mix GDI and cairo, but be sure to calll cairo_surface_flush when
switching between drawing modes.


More information about the cairo mailing list