В конструкторе Joomla 1.5 класса JDocumentPDF
есть параметр массива для настройки некоторых параметров сгенерированного PDF.
function __construct($options = array()) {
parent::__construct($options);
if (isset($options['margin-header'])) {
$this->_margin_header = $options['margin-header'];
}
if (isset($options['margin-footer'])) {
$this->_margin_footer = $options['margin-footer'];
}
if (isset($options['margin-top'])) {
$this->_margin_top = $options['margin-top'];
}
...
}
_createDocument()
функция класса JFactory
создает экземпляр объекта JDocumentPDF
, но неНе передать какие-либо параметры, которые полезны для создания PDF:
function &_createDocument() {
...
$attributes = array (
'charset' => 'utf-8',
'lineend' => 'unix',
'tab' => ' ',
'language' => $lang->getTag(),
'direction' => $lang->isRTL() ? 'rtl' : 'ltr'
);
$doc =& JDocument::getInstance($type, $attributes);
return $doc;
}
Так что я не понимаю, как это работает и где я могу установить эти параметры (margin-header
, margin-footer
и т.д.)?