You are here

public function TcpdfGenerator::setter in PDF generator API 2.x

Same name and namespace in other branches
  1. 8 src/Plugin/PdfGenerator/TcpdfGenerator.php \Drupal\pdf_api\Plugin\PdfGenerator\TcpdfGenerator::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/TcpdfGenerator.php, line 60
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 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
    ->setFooter("");
}