Specifications

LISTING 30.6 Continued
$startx = 70;
pdf_show_xy($pdf, “This is to certify that:”, $startx, 430);
pdf_show_xy($pdf, strtoupper($name), $startx+90, 391);
pdf_set_font($pdf, “Times-Roman”, 20, “host”);
pdf_show_xy($pdf, “has demonstrated that they are certifiable “.
“by passing a rigorous exam”, $startx, 340);
pdf_show_xy($pdf, “consisting of three multiple choice questions.”,
$startx, 310);
pdf_show_xy($pdf, “$name obtained a score of $score”.”%.”, $startx, 260);
pdf_show_xy($pdf, “The test was set and overseen by the “, $startx, 210);
pdf_show_xy($pdf, “Fictional Institute of PHP Certification”,
$startx, 180);
pdf_show_xy($pdf, “on $date.”, $startx, 150);
pdf_show_xy($pdf, “Authorised by:”, $startx, 100);
// add bitmap signature image
$signature = pdf_open_image_file($pdf, “tiff”,
“/htdocs/book/chapter30/signature.tif”);
pdf_place_image($pdf, $signature, 200, 75, 1);
pdf_close_image($pdf, $signature);
pdf_setrgbcolor_fill($pdf, 0, 0, .4); //dark blue
pdf_setrgbcolor_stroke($pdf, 0, 0, 0); // black
// draw ribbon 1
pdf_moveto($pdf, 630, 150);
pdf_lineto($pdf, 610, 55);
pdf_lineto($pdf, 632, 69);
pdf_lineto($pdf, 646, 49);
pdf_lineto($pdf, 666, 150);
pdf_closepath($pdf);
pdf_fill($pdf);
// outline ribbon 1
pdf_moveto($pdf, 630, 150);
pdf_lineto($pdf, 610, 55);
pdf_lineto($pdf, 632, 69);
pdf_lineto($pdf, 646, 49);
Building Practical PHP and MySQL Projects
P
ART V
772
36 7842 CH30 3/6/01 3:40 PM Page 772