Exemplo n.º 1
0
 /**
  * Close the tag and launch the render.
  *
  * Calcul the bar code length and the real coordonate then launch
  * the traitment to draw the bar code.
  *
  * @return void 
  */
 public function close()
 {
     if ($this->position == 'relative') {
         $this->x += $this->pdf->GetX();
         $this->y += $this->pdf->GetY();
     }
     //$clsName = $this->getRenderPlugin();
     $norm = strtolower($this->norm);
     $clsName = Xml2Pdf::searchPlugin($norm, 'barcode');
     call_user_func(array($clsName, 'render'), $this);
     return true;
 }
Exemplo n.º 2
0
 /**
  * Parse the opening tags.
  *
  * Try to instantitate the tag's plugin class.
  *
  * @param object $parser parser xml
  * @param string $tag tag name
  * @param array $tagProperties tag's attributes
  * @return void
  */
 private function _parseOpeningTag($parser, $tag, $tagProperties)
 {
     if (isset($this->_pdf->styles[$tag])) {
         $this->_parseContent($parser, '<' . $tag . '>');
         return;
     }
     if ($this->_donotparse) {
         $tagToText = '<' . strtolower($tag);
         foreach ($tagProperties as $key => $value) {
             $tagToText .= ' ' . strtolower($key) . '="' . $value . '"';
         }
         $tagToText .= '/>';
         $this->_parseContent($parser, $tagToText);
         return;
     }
     $tagName = strtolower($tag);
     $clsName = Xml2Pdf::searchPlugin($tagName);
     try {
         $parent = array_pop($this->_tagStack);
         array_push($this->_tagStack, $parent);
         $this->_tagStack[] = new $clsName($tagProperties, $parent);
         if ($tag == 'LITERAL') {
             $this->_donotparse = true;
         }
     } catch (Exception $e) {
         $this->_tagStack[] = new $clsName($tagProperties);
     }
 }
Exemplo n.º 3
0
 /**
  * Build the graph using appropriate plugin.
  *
  * Instantiate the plugin graph class to render the graph.
  *
  * @return boolean 
  */
 private function _drawGraph()
 {
     $clsName = Xml2Pdf::searchPlugin($this->type, 'graph');
     call_user_func(array($clsName, 'render'), $this);
     return true;
 }