[cairo] Problem with png in pdf documents when using acroread

Eugeniy Meshcheryakov eugen at debian.org
Wed Apr 4 14:41:45 PDT 2007


This problem can be fixed by using cairo_{save,restore} pair, but I
think it is bug in cairo anyway.

> #include <cairo.h>
> #include <cairo-pdf.h>
> 
> int 
> main (int argc, char **argv)
> {
>   int i;
>   cairo_surface_t *surface;
>   cairo_t *cr;
>   cairo_surface_t *image;
> 
>   surface = cairo_pdf_surface_create ("testme.pdf", 4.0*72, 4.0*72);    
>   cr = cairo_create (surface);
>   cairo_surface_destroy (surface);
>   cairo_set_source_rgb (cr, 0.0, 0.0, 0.0);
> 
>   for (i = 0; i < 2; i++)
>     {
cairo_save(cr);
>       cairo_rectangle(cr, 100, 100, 150, 150 );
>       cairo_stroke(cr);
> 
>       image = cairo_image_surface_create_from_png ("logo.png");
>       cairo_set_source_surface (cr, image, 30, 30);
>       cairo_paint (cr);
>       cairo_show_page(cr);
cairo_restore(cr);
>     }
>   cairo_destroy (cr);
>   return 0;
> }
> 



> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo

-- 
Eugeniy Meshcheryakov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.freedesktop.org/archives/cairo/attachments/20070404/09c0d0d5/attachment.pgp


More information about the cairo mailing list