1
在Joomla 1.5的構造函數JDocumentPDF
類有一個數組參數來設置生成的PDF的一些參數。自定義Joomla PDF輸出
JFactory
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()
類實例化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
等)?
get和set將與Joomla繼承的joomla類的ll對象一起工作。 – Gaurav 2011-02-13 17:15:24