public static function pdf_set_default_color(PDFLib $pdf, $type = '')
 {
     $color['r'] = hexdec(substr(self::$defaultColor, 0, 2)) / 255;
     $color['g'] = hexdec(substr(self::$defaultColor, 2, 2)) / 255;
     $color['b'] = hexdec(substr(self::$defaultColor, 4, 2)) / 255;
     if ($type != 'fill' && $type != 'stroke') {
         $type = 'both';
     }
     $pdf->setcolor($type, 'rgb', $color['r'], $color['g'], $color['b'], 0);
 }
Exemple #2
0
 /**
  * Set the current font
  * @param string $type
  */
 protected function setFont($type)
 {
     $this->pdf->setfont($this->pdf->load_font($this->fonts[$type]['face'], "unicode", ""), $this->fonts[$type]['size']);
     $this->pdf->setcolor('fillstroke', 'rgb', $this->fonts[$type]['color'][0] / 255, $this->fonts[$type]['color'][1] / 255, $this->fonts[$type]['color'][2] / 255, 0);
 }