4 draw_pattern ($surface_size)
7 $con = new CairoContext($s);
8 $con->set_source_rgb (1, 1, 1);
9 $con->rectangle (0, 0, $surface_size / 2, $surface_size / 2);
11 $con->set_source_rgb ( 1, 0, 0);
12 $con->rectangle ($surface_size / 2, 0,$surface_size / 2, $surface_size / 2);
14 $con->set_source_rgb ( 0, 1, 0);
15 $con->rectangle (0, $surface_size / 2, $surface_size / 2, $surface_size / 2);
17 $con->set_source_rgb ( 0, 0, 1);
18 $con->rectangle ($surface_size / 2, $surface_size / 2, $surface_size / 2, $surface_size / 2);
20 // $s->write_to_png("temp1.png");
24 $sur = new CairoPDFSurface("pdf-surface-source.pdf", $size, $size);
25 $sur->set_fallback_resolution(72,72);
26 $con = new CairoContext($sur);
28 $con->set_source_rgb(0,0,0);
31 $surface_size = $size - 30;
32 $s = new CairoPDFSurface("temp.pdf", $surface_size, $surface_size);
33 draw_pattern($surface_size);
34 $s->write_to_png("temp1.png");
35 $con->set_source_surface($s, 15.0, 15.0);
37 $sur->write_to_png("pdf-surface-source-php.png");