Esempio n. 1
0
 /**
  * tag : END_LAST_PAGE
  * mode : OPEN
  *
  * @param  array $param
  * @return void
  */
 protected function _tag_open_END_LAST_PAGE($param)
 {
     $height = $this->parsingCss->ConvertToMM($param['end_height'], $this->pdf->getH() - $this->pdf->gettMargin() - $this->pdf->getbMargin());
     if ($height < $this->pdf->getH() - $this->pdf->gettMargin() - $this->pdf->getbMargin() && $this->pdf->getY() + $height >= $this->pdf->getH() - $this->pdf->getbMargin()) {
         $this->_setNewPage();
     }
     $this->parsingCss->save();
     $this->parsingCss->analyse('end_last_page', $param);
     $this->parsingCss->setPosition();
     $this->parsingCss->fontSet();
     $this->pdf->setY($this->pdf->getH() - $this->pdf->getbMargin() - $height);
 }
        /**
         * It is not a real tag. Does not use it directly
         *
         * @param  array $param
         * @return boolean
         */
        protected function _tag_open_PAGE_FOOTER_SUB($param)
        {
            if ($this->_isForOneLine) return false;

            // save the current stat
            $this->_subSTATES = array();
            $this->_subSTATES['x']    = $this->pdf->getX();
            $this->_subSTATES['y']    = $this->pdf->getY();
            $this->_subSTATES['s']    = $this->parsingCss->value;
            $this->_subSTATES['t']    = $this->parsingCss->table;
            $this->_subSTATES['ml']    = $this->_margeLeft;
            $this->_subSTATES['mr']    = $this->_margeRight;
            $this->_subSTATES['mt']    = $this->_margeTop;
            $this->_subSTATES['mb']    = $this->_margeBottom;
            $this->_subSTATES['mp']    = $this->_pageMarges;

            // new stat for the footer
            $this->_pageMarges  = array();
            $this->_margeLeft   = $this->_defaultLeft;
            $this->_margeRight  = $this->_defaultRight;
            $this->_margeTop    = $this->_defaultTop;
            $this->_margeBottom = $this->_defaultBottom;
            $this->pdf->SetMargins($this->_margeLeft, $this->_margeTop, $this->_margeRight);
            $this->pdf->SetAutoPageBreak(false, $this->_margeBottom);
            $this->pdf->setXY($this->_defaultLeft, $this->_defaultTop);

            $this->parsingCss->initStyle();
            $this->parsingCss->resetStyle();
            $this->parsingCss->value['width']    = $this->pdf->getW() - $this->_defaultLeft - $this->_defaultRight;
            $this->parsingCss->table                = array();

            // we create a sub HTML2PFDF, and we execute on it the content of the footer, to get the height of it
            $sub = null;
            $this->_createSubHTML($sub);
            $sub->parsingHtml->code = $this->parsingHtml->getLevel($this->_parsePos);
            $sub->_makeHTMLcode();
            $this->pdf->setY($this->pdf->getH() - $sub->_maxY - $this->_defaultBottom - 0.01);
            $this->_destroySubHTML($sub);

            $this->parsingCss->save();
            $this->parsingCss->analyse('page_footer_sub', $param);
            $this->parsingCss->setPosition();
            $this->parsingCss->fontSet();
            $this->_setNewPositionForNewLine();

            return true;
        }