You are here

protected function ConvertToPdf::importStyles in PDF using mPDF 8.2

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

Check if the custom stylesheet exists.

Return value

bool|string

1 call to ConvertToPdf::importStyles()
ConvertToPdf::generator in src/Conversion/ConvertToPdf.php

File

src/Conversion/ConvertToPdf.php, line 298

Class

ConvertToPdf

Namespace

Drupal\pdf_using_mpdf\Conversion

Code

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