/** * Get page size * * @param $size * @return array|string * @throws PdfException */ protected function _getPageSize($size) { if (is_string($size)) { $size = strtolower($size); if (!$this->_pdfDocument->getStdPageSize($size)) { throw new PdfException('Unknown page size: ' . $size); } $a = $this->_pdfDocument->getStdPageSize($size); return array($a[0] / $this->getDocument()->getScaleFactor(), $a[1] / $this->getDocument()->getScaleFactor()); } elseif ($size[0] > $size[1]) { return array($size[1], $size[0]); } return $size; }