Ejemplo n.º 1
0
 /**
  * création d'un sous HTML2PDF pour la gestion des tableaux imbriqués
  *
  * @param	HTML2PDF	futur sous HTML2PDF passé en référence pour création
  * @param	integer		marge eventuelle de l'objet si simulation d'un TD
  * @return	null
  */
 function createSubHTML(&$sub_html, $cellmargin = 0)
 {
     // calcul de la largueur
     if ($this->style->value['width']) {
         $marge = $cellmargin * 2;
         $marge += $this->style->value['padding']['l'] + $this->style->value['padding']['r'];
         $marge += $this->style->value['border']['l']['width'] + $this->style->value['border']['r']['width'];
         $marge = $this->pdf->getW() - $this->style->value['width'] + $marge;
     } else {
         $marge = $this->margeLeft + $this->margeRight;
     }
     //clonage
     $sub_html = new HTML2PDF($this->sens, $this->format, $this->langue, array($this->defaultLeft, $this->defaultTop, $this->defaultRight, $this->defaultBottom));
     $sub_html->setIsSubPart();
     $sub_html->setEncoding($this->encoding);
     $sub_html->setTestTdInOnePage($this->testTDin1page);
     $sub_html->setTestIsImage($this->testIsImage);
     $sub_html->setTestIsDeprecated($this->testIsDeprecated);
     $sub_html->setDefaultFont($this->defaultFont);
     $sub_html->style->css = $this->style->css;
     $sub_html->style->css_keys = $this->style->css_keys;
     $sub_html->pdf->cloneFontFrom($this->pdf);
     $sub_html->style->table = $this->style->table;
     $sub_html->style->value = $this->style->value;
     $sub_html->style->setOnlyLeft();
     $sub_html->setNewPage($this->format, $this->sens);
     $sub_html->initSubHtml($marge, $this->page, $this->defLIST);
     // initialisation des positions et autre
     $sub_html->maxX = 0;
     $sub_html->maxY = 0;
     $sub_html->maxH = 0;
     $sub_html->pdf->setXY(0, 0);
 }