Horde_Pdf_Writer::_beginPage PHP Method

_beginPage() protected method

Begin a new page.
protected _beginPage ( string $orientation ) : void
$orientation string Orientation code
return void
    protected function _beginPage($orientation)
    {
        $this->_page++;
        // only assign page contents if it is new
        if (!isset($this->_pages[$this->_page])) {
            $this->_pages[$this->_page] = '';
        }
        $this->_state = 2;
        $this->x = $this->_left_margin;
        $this->y = $this->_top_margin;
        $this->_last_height = 0;
        // Page orientation
        if (!$orientation) {
            $orientation = $this->_default_orientation;
        } else {
            $orientation = Horde_String::upper($orientation[0]);
            if ($orientation != $this->_default_orientation) {
                $this->_orientation_changes[$this->_page] = true;
            }
        }
        if ($orientation != $this->_current_orientation) {
            // Change orientation
            if ($orientation == 'P') {
                $this->wPt = $this->fwPt;
                $this->hPt = $this->fhPt;
                $this->w = $this->fw;
                $this->h = $this->fh;
            } else {
                $this->wPt = $this->fhPt;
                $this->hPt = $this->fwPt;
                $this->w = $this->fh;
                $this->h = $this->fw;
            }
            $this->_page_break_trigger = $this->h - $this->_break_margin;
            $this->_current_orientation = $orientation;
        }
    }