_getConfig(); $orientation = isset($config['orientation']) ? $config['orientation'] : 'P'; $unit = isset($config['unit']) ? $config['unit'] : 'mm'; $format = isset($config['format']) ? $config['format'] : 'LETTER'; $unicode = isset($config['unicode']) ? $config['unicode'] : true; $encoding = isset($config['encoding']) ? $config['encoding'] : 'UTF-8'; $diskcache = isset($config['diskcache']) ? $config['diskcache'] : false; $pdfa = isset($config['pdfa']) ? $config['pdfa'] : false; if (!is_dir(K_PATH_CACHE) && !mkdir(K_PATH_CACHE)) { throw new Exception('Can not create TCPDF cache folder "' . K_PATH_CACHE . '"'); } parent::__construct($orientation, $unit, $format, $unicode, $encoding, $diskcache, $pdfa); $this->_init(); return $this; } protected function _init() { $config = $this->_getConfig(); if (isset($config['imageScaleRatio'])) { $this->setImageScale((float) $config['imageScaleRatio']); } if (!empty($config['addEmptyPage'])) { $this->addPage(); } return $this; } protected function _getConfig() { if (null === $this->_config) { $this->_config = Qs_Config::getByInstance($this)->toArray(); } return $this->_config; } }