You are here

function printable_preparing_pdf in Printer and PDF versions for Drupal 8+ 2.x

Same name and namespace in other branches
  1. 8 printable.module \printable_preparing_pdf()

Are we in the process of generating a PDF?

Return value

bool Whether we are preparing a PDF.

2 calls to printable_preparing_pdf()
printable_file_url_alter in ./printable.module
Make file urls absolute if we're generating a PDF.
printable_link_alter in ./printable.module
Make Link URLs absolute if we're generating a PDF.

File

./printable.module, line 256
Provides printer friendly content entities.

Code

function printable_preparing_pdf() {
  $match = \Drupal::routeMatch();
  $routename = $match
    ->getMasterRouteMatch()
    ->getRouteName();
  return $routename && substr($routename, 0, 21) == 'printable.show_format' && $match
    ->getParameter('printable_format') == 'pdf';
}