You are here

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

Set the various options for PDF.

Parameters

string $pdf_content: The HTML content of PDF.

string $pdf_location: The location where PDF needs to be saved.

bool $save_pdf: Stores the configuration whether PDF needs to be saved or shown inline.

string $paper_orientation: The orientation of PDF pages (portrait or landscape).

string $paper_size: The size of PDF paper (e.g. A4, B4, Letter).

string $footer_content: The text to be rendered as footer.

string $header_content: The text to be rendered as header.

string $path_to_binary: The path to binary file.

Overrides PdfGeneratorInterface::setter

File

src/Plugin/PdfGenerator/DompdfGenerator.php, line 63
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 setter($pdf_content, $pdf_location, $save_pdf, $paper_orientation, $paper_size, $footer_content, $header_content, $path_to_binary = '') {
  $this
    ->setPageOrientation($paper_orientation);
  $this
    ->addPage($pdf_content);
  $this
    ->setHeader($header_content);
}