You are here

function pdf_using_mpdf_mpdf_html_alter in PDF using mPDF 8.2

Alter html passed to PDF file before conversion

Implements hook_mpdf_html_alter()

Parameters

string $html:

\Drupal\node\NodeInterface $node:

File

./pdf_using_mpdf.api.php, line 11

Code

function pdf_using_mpdf_mpdf_html_alter(&$html, $node) {

  // Append custom HTMl to node type `page`
  if ($node
    ->getType() == 'page') {
    $div = '<div>';
    $div .= 'This is super cool way to generate a PDF file!';
    $div .= '</div>';
    $html .= $div;
  }
}