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

Davide Viti zinosat at tiscali.it
Wed Apr 4 14:22:30 PDT 2007


On Wed, Apr 04, 2007 at 11:18:57PM +0200, Eugeniy Meshcheryakov wrote:
> 4 квітня 2007 о 23:14 +0200 Eugeniy Meshcheryakov написав(-ла):
> > drawn before drawing the image, equals n_rectangles*(n_pages-1)+1
> well, (n_rectangles + 1)*(n_pages - 1) + 1 is more correct, tested for
> n_rectangles = 1,2 for other values formula may be different

I also found out that if you fille the rectangle acroread has no problems
showing it:

#include <stdio.h>
#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_set_source_rgb(cr, 0.8, 0.8, 0.8);
      cairo_rectangle(cr, 100, 100, 150, 150 );
      cairo_fill(cr);

      cairo_set_source_rgb(cr, 0.0, 0.0, 0.0);
      cairo_rectangle(cr, 100, 100, 150, 150 );

      cairo_stroke(cr);

      image = cairo_image_surface_create_from_png ("glider.png");
      cairo_set_source_surface (cr, image, 30, 30);
      cairo_paint (cr);

      cairo_show_page(cr);
    }
  cairo_destroy (cr);
  return 0;
}


regards,
Davide
-------------- 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/408433cd/attachment-0001.pgp


More information about the cairo mailing list