4 draw_pattern ($surface_size)
7 $con = new CairoContext($s);
8 $con->setSourceRgb (1, 1, 1);
9 $con->rectangle (0, 0, $surface_size / 2, $surface_size / 2);
11 $con->setSourceRgb ( 1, 0, 0);
12 $con->rectangle ($surface_size / 2, 0,$surface_size / 2, $surface_size / 2);
14 $con->setSourceRgb ( 0, 1, 0);
15 $con->rectangle (0, $surface_size / 2, $surface_size / 2, $surface_size / 2);
17 $con->setSourceRgb ( 0, 0, 1);
18 $con->rectangle ($surface_size / 2, $surface_size / 2, $surface_size / 2, $surface_size / 2);
20 // $s->writeToPng("temp1.png");
24 $sur = new CairoPDFSurface("pdf-surface-source.pdf", $size, $size);
25 $sur->setFallbackResolution(72,72);
26 $con = new CairoContext($sur);
28 $con->setSourceRgb(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->writeToPng("temp1.png");
35 $con->setSourceSurface($s, 15.0, 15.0);
37 $sur->writeToPng("pdf-surface-source-php.png");