Community
Participate
Working Groups
I'm using the new GTK printing code that's in 3.3 (3.3M5). This works well except when I try to use the drawImage() method with the printer gc. In this case printing fails silently (no exceptions, no output). I'm on Ubuntu 6.10 which has libcairo2 1.2.4. I can't test another distribution right now but will do so in the next few days (there's another bug with drawImage that occurs with cairo 1.2 only, so maybe this is dependent on the cairo version too). Having this fixed would be quite important for us since we're planning to ship the Linux version of our product (a PDF editor) in March. I can't explain to a potential customer that she will be able to print on Windows but not on Linux.
Carolyn, we've seen images print before, right? Sounds like a bug/feature in the version of cairo they are using.
Found out now that the problem doesn't occur when the image in question has alpha data. I suspect the cairo_xlib_surface_create that is done for an image without alpha in Image.createSurface() is the culprit. Seems as if the pattern later created from the xlib surface and the printer surface it's to be painted on don't get along. The obvious workaround is to initialize alphaData to an all -1 byte array.
CAR, can you and SSQ confirm this work around?
Just curious - by any chance does it work ok when it's a PNG24 image, as mentioned in bug 174714 ?
I can print the image from #174714 just fine with the latest SWT. This image has transparentPixel set to 0. I'm only seeing the problem described here when an image has no transparency at all i.e. the "else" branch just at the end of Image.createSurface() is reached. And I never get garbled images in that case; the printer simply won't print the page. You might ask the other reporter for his cairo version. As I said, I have 1.2.4 and don't see the other problem.
(In reply to Elfi Heck from comment #5) > I can print the image from #174714 just fine with the latest SWT. Based on this, closing.