You are here

public function DompdfGenerator::setPageOrientation 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::setPageOrientation()

Set the paper orientation of the generated PDF pages.

Parameters

PdfGeneratorInterface::PORTRAIT|PdfGeneratorInterface::LANDSCAPE $orientation: The orientation of the PDF pages.

Overrides PdfGeneratorInterface::setPageOrientation

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

File

src/Plugin/PdfGenerator/DompdfGenerator.php, line 95
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 setPageOrientation($orientation = PdfGeneratorInterface::PORTRAIT) {
  $this->generator
    ->set_paper("", $orientation);
}