You are here

public function PdfFormat::buildPdfContent in Printer and PDF versions for Drupal 8+ 2.x

Same name and namespace in other branches
  1. 8 modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php \Drupal\printable_pdf\Plugin\PrintableFormat\PdfFormat::buildPdfContent()

Get the HTML content for PDF generation.

Return value

string HTML content for PDF.

1 call to PdfFormat::buildPdfContent()
PdfFormat::getResponse in modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php
Returns the response object for this format plugin.

File

modules/printable_pdf/src/Plugin/PrintableFormat/PdfFormat.php, line 245

Class

PdfFormat
Provides a plugin to display a PDF version of a page.

Namespace

Drupal\printable_pdf\Plugin\PrintableFormat

Code

public function buildPdfContent() {
  $content = parent::buildContent();
  $content = render($content);
  $content = preg_replace([
    '#printable://#',
    '/\\?itok=.*"/',
  ], [
    '',
    '"',
  ], $content);
  $rendered_page = parent::extractLinks($content);
  return $rendered_page;
}