Esempio n. 1
0
 /**
  * create a new page
  *
  * @access protected
  * @param  mixed   $format
  * @param  string  $orientation
  * @param  array   $background background information
  * @param  integer $curr real position in the html parser (if break line in the write of a text)
  * @param  boolean $resetPageNumber
  */
 protected function _setNewPage($format = null, $orientation = '', $background = null, $curr = null, $resetPageNumber = false)
 {
     $this->_firstPage = false;
     $this->_format = $format ? $format : $this->_format;
     $this->_orientation = $orientation ? $orientation : $this->_orientation;
     $this->_background = $background !== null ? $background : $this->_background;
     $this->_maxY = 0;
     $this->_maxX = 0;
     $this->_maxH = 0;
     $this->_maxE = 0;
     $this->pdf->SetMargins($this->_defaultLeft, $this->_defaultTop, $this->_defaultRight);
     if ($resetPageNumber) {
         $this->pdf->startPageGroup();
     }
     $this->pdf->AddPage($this->_orientation, $this->_format);
     if ($resetPageNumber) {
         $this->pdf->myStartPageGroup();
     }
     $this->_page++;
     if (!$this->_subPart && !$this->_isSubPart) {
         if (is_array($this->_background)) {
             if (isset($this->_background['color']) && $this->_background['color']) {
                 $this->pdf->setFillColorArray($this->_background['color']);
                 $this->pdf->Rect(0, 0, $this->pdf->getW(), $this->pdf->getH(), 'F');
             }
             if (isset($this->_background['img']) && $this->_background['img']) {
                 $this->pdf->Image($this->_background['img'], $this->_background['posX'], $this->_background['posY'], $this->_background['width']);
             }
         }
         $this->_setPageHeader();
         $this->_setPageFooter();
     }
     $this->_setMargins();
     $this->pdf->setY($this->_margeTop);
     $this->_setNewPositionForNewLine($curr);
     $this->_maxH = 0;
 }