You are here

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

Same name and namespace in other branches
  1. 8 src/Plugin/PdfGenerator/WkhtmltopdfGenerator.php \Drupal\pdf_api\Plugin\PdfGenerator\WkhtmltopdfGenerator::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 WkhtmltopdfGenerator::setPageSize()
WkhtmltopdfGenerator::setter in src/Plugin/PdfGenerator/WkhtmltopdfGenerator.php
Set the various options for PDF.

File

src/Plugin/PdfGenerator/WkhtmltopdfGenerator.php, line 115
Contains \Drupal\pdf_api\Plugin\WkhtmltopdfGenerator.

Class

WkhtmltopdfGenerator
A PDF generator plugin for the WKHTMLTOPDF library.

Namespace

Drupal\pdf_api\Plugin\PdfGenerator

Code

public function setPageSize($page_size) {
  if ($this
    ->isValidPageSize($page_size)) {
    $this
      ->setOptions(array(
      'page-size' => $page_size,
    ));
  }
}