You are here

public function TcpdfGenerator::setPageSize in PDF generator API 8

Same name and namespace in other branches
  1. 2.x src/Plugin/PdfGenerator/TcpdfGenerator.php \Drupal\pdf_api\Plugin\PdfGenerator\TcpdfGenerator::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/TcpdfGenerator.php, line 104
Contains \Drupal\pdf_api\Plugin\TcpdfGenerator.

Class

TcpdfGenerator
A PDF generator plugin for the mPDF library.

Namespace

Drupal\pdf_api\Plugin\PdfGenerator

Code

public function setPageSize($page_size) {
  if ($this
    ->isValidPageSize($page_size)) {
    $this->generator
      ->AddPage("", $page_size, FALSE, TRUE);
  }
}