Esempio n. 1
0
 /**
  * Set the New position for the current Tag
  *
  * @return void
  */
 public function setPosition()
 {
     // get the current position
     $currentX = $this->pdf->getX();
     $currentY = $this->pdf->getY();
     // save it
     $this->value['xc'] = $currentX;
     $this->value['yc'] = $currentY;
     if ($this->value['position'] == 'relative' || $this->value['position'] == 'absolute') {
         if ($this->value['right'] !== null) {
             $x = $this->getLastWidth(true) - $this->value['right'] - $this->value['width'];
             if ($this->value['margin']['r']) {
                 $x -= $this->value['margin']['r'];
             }
         } else {
             $x = $this->value['left'];
             if ($this->value['margin']['l']) {
                 $x += $this->value['margin']['l'];
             }
         }
         if ($this->value['bottom'] !== null) {
             $y = $this->getLastHeight(true) - $this->value['bottom'] - $this->value['height'];
             if ($this->value['margin']['b']) {
                 $y -= $this->value['margin']['b'];
             }
         } else {
             $y = $this->value['top'];
             if ($this->value['margin']['t']) {
                 $y += $this->value['margin']['t'];
             }
         }
         if ($this->value['position'] == 'relative') {
             $this->value['x'] = $currentX + $x;
             $this->value['y'] = $currentY + $y;
         } else {
             $this->value['x'] = $this->getLastAbsoluteX() + $x;
             $this->value['y'] = $this->getLastAbsoluteY() + $y;
         }
     } else {
         $this->value['x'] = $currentX;
         $this->value['y'] = $currentY;
         if ($this->value['margin']['l']) {
             $this->value['x'] += $this->value['margin']['l'];
         }
         if ($this->value['margin']['t']) {
             $this->value['y'] += $this->value['margin']['t'];
         }
     }
     // save the new position
     $this->pdf->setXY($this->value['x'], $this->value['y']);
 }
Esempio n. 2
0
 /**
  * new page for the automatic Index, do not use this method. Only myPdf could use it !!!!
  *
  * @param  &int $page
  * @return integer $oldPage
  */
 public function _INDEX_NewPage(&$page)
 {
     if ($page) {
         $oldPage = $this->pdf->getPage();
         $this->pdf->setPage($page);
         $this->pdf->setXY($this->_margeLeft, $this->_margeTop);
         $this->_maxH = 0;
         $page++;
         return $oldPage;
     } else {
         $this->_setNewPage();
         return null;
     }
 }