You are here

public function MpdfGenerator::setPageSize in PDF generator API 8

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

1 call to MpdfGenerator::setPageSize()
MpdfGenerator::setter in src/Plugin/PdfGenerator/MpdfGenerator.php
Set the various options for PDF.

File

src/Plugin/PdfGenerator/MpdfGenerator.php, line 126
Contains \Drupal\pdf_api\Plugin\MpdfGenerator.

Class

MpdfGenerator
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
      ->setOptions(array(
      'sheet-size' => $page_size,
    ));
  }
}