You are here

public function DompdfGenerator::setPageSize in PDF generator API 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/PdfGenerator/DompdfGenerator.php \Drupal\pdf_api\Plugin\PdfGenerator\DompdfGenerator::setPageSize()

Set the page size of the generated PDF pages.

Parameters

string $page_size: The page size (e.g. A4, B2, Letter).

Overrides PdfGeneratorInterface::setPageSize

File

src/Plugin/PdfGenerator/DompdfGenerator.php, line 102
Contains \Drupal\pdf_api\Plugin\DompdfGenerator.

Class

DompdfGenerator
A PDF generator plugin for the dompdf library.

Namespace

Drupal\pdf_api\Plugin\PdfGenerator

Code

public function setPageSize($page_size) {
  if ($this
    ->isValidPageSize($page_size)) {
    $this->generator
      ->set_paper($page_size);
  }
}