You are here

public function TcpdfGenerator::setFooter 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::setFooter()

Sets the footer in the PDF.

Parameters

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

Overrides PdfGeneratorInterface::setFooter

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

File

src/Plugin/PdfGenerator/TcpdfGenerator.php, line 113
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 setFooter($text) {
  $this->generator
    ->writeHtmlCell("", 3, 20, 4, '<p>Page ' . $this->generator
    ->getAliasNumPage() . ' of  ' . ' ' . $this->generator
    ->getAliasNbPages() . '</p>', '', 1, 0, FALSE, 'R');
}