You are here

public function ConvertToPdf::getDefaultConfig 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::getDefaultConfig()

Configuration values to instantiate Mpdf constructor.

Return value

array Default configuration.

1 call to ConvertToPdf::getDefaultConfig()
ConvertToPdf::init in src/Conversion/ConvertToPdf.php
Instantiate Mpdf object.

File

src/Conversion/ConvertToPdf.php, line 284

Class

ConvertToPdf
Class ConvertToPdf.

Namespace

Drupal\pdf_using_mpdf\Conversion

Code

public function getDefaultConfig() {
  $orientation = $this->settings['orientation'] == 'L' ? '-L' : '';
  $config = [
    'tempDir' => file_directory_temp(),
    'useActiveForms' => TRUE,
    'format' => $this->settings['pdf_page_size'] . $orientation,
    'default_font_size' => $this->settings['pdf_font_size'] . 'pt',
    'default_font' => $this->settings['pdf_default_font'],
    'margin_left' => $this->settings['margin_left'],
    'margin_right' => $this->settings['margin_right'],
    'margin_top' => $this->settings['margin_top'],
    'margin_bottom' => $this->settings['margin_bottom'],
    'margin_header' => $this->settings['margin_header'],
    'margin_footer' => $this->settings['margin_footer'],
    'dpi' => $this->settings['dpi'],
    'img_dpi' => $this->settings['img_dpi'],
    'enabled_content_types' => $this->settings['enabled_content_types'],
  ];
  return $config;
}