[cairo] Problem with png in pdf documents when using acroread
zinosat at tiscali.it
Wed Apr 4 10:41:52 PDT 2007
I have a problem when including a png image in a PDF document which
shows up when using Acrobat Reader, but not with evince / xpdf:
the rectangle gets drawn in the first page but not in the following pages.
If you remove the block of code that draws the png image, the problem
disappears. Note also that if you draw the png first, and then draw the
rectangle, the problem reproduces on all pages (including the first).
I've reproduced this both with the cairo package included in debian
unstable (1.2.4) and with the 1.4.2 snapshot.
I narrowed down the testcase to the code snippet at the bottom of this message.
In case anyone wanted to see directly the pdf file, you can find it in  (~7 Kb)
It's probably a problem with Acrobat Reader but it'd be nice if it'd be
possible to workaround it somehow maybe making sure the pdf backend
produce acroread-friendly files.
/* ------ code snippet ------ */
main (int argc, char **argv)
surface = cairo_pdf_surface_create ("testme.pdf", 4.0*72, 4.0*72);
cr = cairo_create (surface);
cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
for (i = 0; i < 2; i++)
cairo_rectangle(cr, 100, 100, 150, 150 );
image = cairo_image_surface_create_from_png ("logo.png");
cairo_set_source_surface (cr, image, 30, 30);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070404/f7c05425/attachment.pgp
More information about the cairo