You are here

protected function ConvertToPdf::importStyles in PDF using mPDF 8

Same name and namespace in other branches
  1. 8.2 src/Conversion/ConvertToPdf.php \Drupal\pdf_using_mpdf\Conversion\ConvertToPdf::importStyles()

Check if the custom stylesheet exists.

Return value

string The css file.

1 call to ConvertToPdf::importStyles()
ConvertToPdf::generator in src/Conversion/ConvertToPdf.php
Generate the PDF file using the Mpdf library.

File

src/Conversion/ConvertToPdf.php, line 312

Class

ConvertToPdf
Class ConvertToPdf.

Namespace

Drupal\pdf_using_mpdf\Conversion

Code

protected function importStyles() {
  $file = '';
  $path = DRUPAL_ROOT . '/' . $this->settings['pdf_css_file'];
  if (file_exists($path)) {
    $file = file_get_contents($path);
  }
  return $file;
}