function fromNode($node) { parent::fromNode($node); //----------- applyDynamic... // look for if (empty($this->children)) { return; } if (empty($this->dynamic)) { return; } $settings = array('rows' => $this->rows, 'cols' => $this->cols, 'dynamic' => $this->dynamic); //look for the bounding box.. $boundingbox = false; foreach (array_keys($this->children) as $k) { if (!is_a($this->children[$k], 'XML_SvgToPDF_Rect')) { continue; } if (@$this->children[$k]->nonprintable == 'true') { $boundingbox = clone $this->children[$k]; $this->children[$k]->style['fill'] = 'none'; // unset($this->children[$k]); } } if (!$boundingbox) { return; } //echo "<PRE>";print_r($boundingbox ); $this->boundingbox = $boundingbox; $this->settings = $settings; $this->shiftChildren($this->boundingbox->x, $this->boundingbox->y); }
function fromNode($node) { parent::fromNode($node); static $trans = false; if (!$trans) { $trans = array_flip(get_html_translation_table(HTML_ENTITIES)); } if (@$this->content) { if (strpos($this->content, '&') !== false) { $this->content = strtr($this->content, $trans); $this->content = str_replace(''', "'", $this->content); } if (false === strpos($this->content, '{')) { return; } preg_match_all('/\\{([a-z_]+(\\(\\))?)\\}/i', $this->content, $matches); //if (false !== strpos($this->content,'(')) { // echo "<PRE>";print_R($matches); // exit; //} $this->args = $matches[1]; foreach ($this->args as $v) { $this->content = str_replace('{' . $v . '}', '%s', $this->content); } //$this->content = preg_replace('/\{('.implode('|',$matches[1]).')\}/','%s',$this->content); } }
function fromNode($node) { parent::fromNode($node); // look for if (!@$this->children) { return; } $settings = array('rows' => 1, 'cols' => 1); $isDynamic = false; foreach (array_keys($this->children) as $k) { if (!is_a($this->children[$k], 'XML_SvgToPDF_Text')) { continue; } if (strpos($this->children[$k]->children[0]->content, '=') === false) { continue; } foreach ($this->children[$k]->children as $o) { list($l, $r) = explode('=', $o->content); $settings[$l] = $r; } unset($this->children[$k]); $isDynamic = true; break; } if (!$isDynamic) { return; } //look for the bounding box.. $boundingbox = false; foreach (array_keys($this->children) as $k) { if (!is_a($this->children[$k], 'XML_SvgToPDF_Rect')) { continue; } if (@$this->children[$k]->nonprintable == 'true') { $boundingbox = $this->children[$k]; // $this->children[$k]->style['fill'] = 'none'; unset($this->children[$k]); } } if (!$boundingbox) { return; } $this->boundingbox = $boundingbox; $this->settings = $settings; $this->shiftChildren($this->boundingbox->x, $this->boundingbox->y); }
function fromNode($node) { parent::fromNode($node); $d = explode(' ', trim($this->d)); $i = 0; $data = array(); while ($i < count($d)) { $action = $d[$i]; switch (strtolower($action)) { case 'm': // move // move case 'l': // line $data[] = array($action, $d[$i + 1], $d[$i + 2]); $i += 3; break; case 'h': // move horizontal // move horizontal case 'v': // move horizontal $data[] = array($action, $d[$i + 1]); $i += 2; break; case 'z': // close path.. $data[] = array($action); $i++; break; default: echo "oops found something odd in path? '{$action}'"; echo $this->d; exit; break; } } $this->d = $data; }