示例#1
1
 /**
  * balise : QRCODE
  * mode : OUVERTURE
  * 
  * @param	array	paramètres de l'élément de parsing
  * @return	null
  */
 function o_QRCODE($param)
 {
     if ($this->DEBUG_actif) {
         $this->DEBUG_add('QRCODE', true);
     }
     if (!isset($param['value'])) {
         $param['value'] = '';
     }
     if (!isset($param['ec'])) {
         $param['ec'] = 'H';
     }
     if (!isset($param['size'])) {
         $param['size'] = '0.6mm';
     }
     if (!isset($param['style']['color'])) {
         $param['style']['color'] = '#000000';
     }
     if (!isset($param['style']['background-color'])) {
         $param['style']['background-color'] = '#FFFFFF';
     }
     if ($param['value'] === '') {
         return true;
     }
     $this->style->save();
     $this->style->analyse('qrcode', $param);
     $this->style->setPosition($this->pdf->x, $this->pdf->y);
     $this->style->FontSet();
     $x = $this->pdf->getX();
     $y = $this->pdf->getY();
     $s = $this->style->ConvertToMM($param['size']);
     $ec = $param['ec'];
     if (!in_array($ec, array('L', 'M', 'Q', 'H'))) {
         $ec = 'H';
     }
     $color = $this->style->value['color'];
     $background = $this->style->value['background']['color'];
     require_once dirname(__FILE__) . '/qrcode/qrcode.class.php';
     $qrcode = new QRcode($param['value'], $ec);
     $size = $s * $qrcode->getQrSize();
     if (!$this->sub_part && !$this->isSubPart) {
         $qrcode->displayFPDF($this->pdf, $x, $y, $s, $background, $color);
     }
     unset($qrcode);
     // position maximale globale
     $this->maxX = max($this->maxX, $x + $size);
     $this->maxY = max($this->maxY, $y + $size);
     $this->maxH = max($this->maxH, $size);
     $this->pdf->setX($x + $size);
     $this->style->load();
     $this->style->FontSet();
     return true;
 }