Specifications
LISTING 30.6 Continued
$y = $radius*sin($angle) + $centery;
}
else
{
$x = $inner_radius*cos($angle) + $centerx;
$y = $inner_radius*sin($angle) + $centery;
}
if($i==0)
pdf_moveto($pdf, $x, $y);
else if($i==$points*2)
pdf_closepath($pdf);
else
pdf_lineto($pdf, $x, $y);
}
if($filled)
pdf_fill($pdf);
pdf_stroke($pdf);
}
?>
The certificate produced using this script is shown in Figure 30.7. As you can see, it is quite
similar to the others, except that the border is simpler and the star looks a little different. This
is because we have drawn them into the document rather than using an existing clip art file.
Building Practical PHP and MySQL Projects
P
ART V
774
F
IGURE 30.7
pdflib.php draws the certificate into a PDF document.
36 7842 CH30 3/6/01 3:40 PM Page 774