Esempio n. 1
0
 /**
  * Get the PDF linestyle
  *
  * @param mixed $lineStyle The line style to return, false if the one
  *   explicitly set
  * @return bool True if set (so that a line should be drawn)
  * @access private
  */
 function _setLineStyle($lineStyle = false)
 {
     if ($lineStyle === false) {
         $lineStyle = $this->_lineStyle;
     }
     if ($lineStyle == 'transparent' || $lineStyle === false) {
         return false;
     }
     if (is_array($lineStyle)) {
         // TODO Implement linestyles in PDFlib (using pdf_setcolor(.., 'pattern'...); ?
         reset($lineStyle);
         $lineStyle = current($lineStyle);
     }
     $color = $this->_color($lineStyle);
     pdf_setlinewidth($this->_pdf, $this->_thickness);
     if ($this->_pdflib < 4) {
         pdf_setrgbcolor_stroke($this->_pdf, $color[0] / 255, $color[1] / 255, $color[2] / 255);
     } else {
         pdf_setcolor($this->_pdf, 'stroke', 'rgb', $color[0], $color[1], $color[2], 0);
     }
     return true;
 }
Esempio n. 2
0
 }
 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, 'png', 'signature.png');
 pdf_place_image($pdf, $signature, 200, 75, 1);
 pdf_close_image($pdf, $signature);
 // set up colors for rosette
 pdf_setrgbcolor_fill($pdf, 0, 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);
 pdf_lineto($pdf, 666, 150);