You are here

public function DompdfGenerator::setHeader in PDF generator API 8

Same name and namespace in other branches
  1. 2.x src/Plugin/PdfGenerator/DompdfGenerator.php \Drupal\pdf_api\Plugin\PdfGenerator\DompdfGenerator::setHeader()

Sets the header in the PDF.

Parameters

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

Overrides PdfGeneratorInterface::setHeader

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

File

src/Plugin/PdfGenerator/DompdfGenerator.php, line 79
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 setHeader($text) {
  $canvas = $this->generator
    ->get_canvas();
  $canvas
    ->page_text(72, 18, "Header: {PAGE_COUNT}", "", 11, array(
    0,
    0,
    0,
  ));
}