You are here

protected function PdfGeneratorBase::getPageDimensions in PDF generator API 8

Same name and namespace in other branches
  1. 2.x src/Plugin/PdfGeneratorBase.php \Drupal\pdf_api\Plugin\PdfGeneratorBase::getPageDimensions()

Get the dimensions of a given page size.

Parameters

string $page_size: The page size to get the dimensions for (e.g. A4).

Return value

array|FALSE An array with the keys "width" and "height" that contain the width and height dimensions respectively. False if the page size is unknown.

File

src/Plugin/PdfGeneratorBase.php, line 59
Contains \Drupal\printable\Plugin\PrintableFormatBase.

Class

PdfGeneratorBase
Provides a base class for PDF generator plugins.

Namespace

Drupal\pdf_api\Plugin

Code

protected function getPageDimensions($page_size) {
  if ($this
    ->isValidPageSize($page_size)) {
    $page_sizes = $this
      ->pageSizes();
    return $page_sizes[$page_size];
  }
}