811
306
بناء مشاريع PHP و MySQL عملية
الجزء V
//draw inner border
pdf_rect($pdf, $inset+$border+$inner,
$inset+$border+$inner,
$width -2*($inset+$border+$inner), $height -2*($inset+$border+$inner));
pdf_stroke($pdf);
//add text
pdf_set_font($pdf, "Times - Roman", 48, "host");
$startx = ($width
-
-pdf_stringwidth($pdf, "PHP Certification"))/2;
pdf_show_xy($pdf, "PHP Certification", $startx, 490);
pdf_set_font($pdf, "Times - Roman", 26, "host");
$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 $sc ore"."%.", $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);
// draw ribbon 1
// black
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);
ص٧٩٥