function _beginpage($orientation, $size) { $this->page++; $this->pages[$this->page] = ''; $this->state = 2; $this->x = $this->lMargin; $this->y = $this->tMargin; $this->FontFamily = ''; // Check page size and orientation if ($orientation == '') { $orientation = $this->DefOrientation; } else { $orientation = strtoupper($orientation[0]); } if ($size == '') { $size = $this->DefPageSize; } else { $size = $this->_getpagesize($size); } if ($orientation != $this->CurOrientation || $size[0] != $this->CurPageSize[0] || $size[1] != $this->CurPageSize[1]) { // New size or orientation if ($orientation == 'P') { $this->w = $size[0]; $this->h = $size[1]; } else { $this->w = $size[1]; $this->h = $size[0]; } $this->wPt = $this->w * $this->k; $this->hPt = $this->h * $this->k; $this->PageBreakTrigger = $this->h - $this->bMargin; $this->CurOrientation = $orientation; $this->CurPageSize = $size; } if ($orientation != $this->DefOrientation || $size[0] != $this->DefPageSize[0] || $size[1] != $this->DefPageSize[1]) { $this->PageSizes[$this->page] = array($this->wPt, $this->hPt); } }