/** * Class constructor * * @param JDocument &$doc A reference to the JDocument object that instantiated the renderer * * @since 11.1 */ public function __construct(&$doc) { $this->jdoc =& $doc; // set default values $orientation = isset($doc->orientation) ? $doc->orientation : 'P'; // $unit = isset($doc->unit) ? $doc->unit : 'mm'; $format = isset($doc->format) ? $doc->format : 'A4'; // $unicode = isset($doc->unicode) ? $doc->unicode : true; // $pdfa = isset($doc->pdfa) ? $doc->pdfa : false; // PDFA true include more datas but render same in all computers. For a web site this can be very longer setted to true. // $encoding always utf8 // $diskcache=false; // true : compatible with joomla ? parent::__construct('', $format, 0, '', $doc->_margin_left, $doc->_margin_right, $doc->_margin_top, $doc->_margin_bottom, $doc->_margin_header, $doc->_margin_footer, $orientation); // set default header/footer $app = JFactory::getApplication(); // if ($app->getCfg('sitename_pagetitles', 0) == 1) // { $title = $app->getCfg('sitename'); // } // elseif ($app->getCfg('sitename_pagetitles', 0) == 2) // { // $title = JText::sprintf('JPAGETITLE', $doc->title, $app->getCfg('sitename')); // } // else // { // $title = $doc->title; // } }
function Ticket2PDF($ticket, $psize = 'Letter', $notes = false) { global $thisstaff; $this->ticket = $ticket; $this->includenotes = $notes; parent::__construct('', $psize); $this->SetMargins(10, 10, 10); $this->AliasNbPages(); $this->AddPage(); $this->cMargin = 3; $this->_print(); }
/** * Class constructor * * @param JDocument &$doc A reference to the JDocument object that instantiated the renderer * * @since 11.1 */ public function __construct(&$doc) { $this->jdoc =& $doc; // set default values $orientation = isset($doc->orientation) ? $doc->orientation : 'P'; // $unit = isset($doc->unit) ? $doc->unit : 'mm'; $format = isset($doc->format) ? $doc->format : 'A4'; // $unicode = isset($doc->unicode) ? $doc->unicode : true; // $pdfa = isset($doc->pdfa) ? $doc->pdfa : false; // PDFA true include more datas but render same in all computers. For a web site this can be very longer setted to true. // $encoding always utf8 // $diskcache=false; // true : compatible with joomla ? parent::__construct('c', $format, '', '', $doc->_margin_left, $doc->_margin_right, $doc->_margin_top, $doc->_margin_bottom, $doc->_margin_header, $doc->_margin_footer, $orientation); $app = JFactory::getApplication(); }
/** * Initializes the pager by setting some default property values. * @param string $html * @param string $title * @param mixed $format * @param string $orientation */ public function __construct($html, $title = '', $format = 'A4', $orientation = 'P') { parent::__construct($this->mode, $format, $this->defaultFontSize, $this->defaultFont, $this->marginLeft, $this->marginRight, $this->marginTop, $this->marginBottom, $this->marginHeader, $this->marginFooter, $orientation); $controller = new CController('PDF'); $controller->layout = $this->layouts; $html = $controller->renderText($html, true); $this->SetCreator($this->creator); $this->SetTitle($title); if (!UserWeb::instance()->isGuest) { $this->SetFooter(sprintf('Berkas dicetak oleh %s, %s||{PAGENO}', UserWeb::instance()->user()->username, date('Y-m-d H:i:s'))); } else { throw new CHttpException(403, 'Anda tidak memiliki otoritas untuk mengakses halaman ini'); } $this->writeHTML($html); }
/** * modPDF constructor * * @param modX $modx A reference to the modX instance. * @param array $options An array of options. Optional. */ function __construct(modX &$modx, array $options = array()) { $this->modx =& $modx; $corePath = $this->getOption('core_path', $options, $this->modx->getOption('core_path') . 'components/' . $this->namespace . '/'); $assetsPath = $this->getOption('assets_path', $options, $this->modx->getOption('assets_path') . 'components/' . $this->namespace . '/'); $assetsUrl = $this->getOption('assets_url', $options, $this->modx->getOption('assets_url') . 'components/' . $this->namespace . '/'); $pdfPath = $this->getOption('pdf_path', $options, $this->modx->getOption('assets_path') . 'pdf/'); $pdfUrl = $this->getOption('pdf_url', $options, $this->modx->getOption('assets_url') . 'pdf/'); // Load some default paths for easier management $this->options = array_merge(array('namespace' => $this->namespace, 'version' => $this->version, 'assetsPath' => $assetsPath, 'assetsUrl' => $assetsUrl, 'cssUrl' => $assetsUrl . 'css/', 'jsUrl' => $assetsUrl . 'js/', 'imagesUrl' => $assetsUrl . 'images/', 'corePath' => $corePath, 'modelPath' => $corePath . 'model/', 'vendorPath' => $corePath . 'vendor/', 'chunksPath' => $corePath . 'elements/chunks/', 'pagesPath' => $corePath . 'elements/pages/', 'snippetsPath' => $corePath . 'elements/snippets/', 'pluginsPath' => $corePath . 'elements/plugins/', 'controllersPath' => $corePath . 'controllers/', 'processorsPath' => $corePath . 'processors/', 'templatesPath' => $corePath . 'templates/', 'connectorUrl' => $assetsUrl . 'connector.php', 'pdfPath' => $pdfPath, 'pdfUrl' => $pdfUrl), $options); // Init mPDF options $mode = $this->modx->getOption('mode', $options, ''); $format = $this->modx->getOption('format', $options, 'A4'); $default_font_size = intval($this->modx->getOption('defaultFontSize', $options, 0)); $default_font = $this->modx->getOption('defaultFont', $options, ''); $mgl = intval($this->modx->getOption('mgl', $options, 15)); $mgr = intval($this->modx->getOption('mgr', $options, 15)); $mgt = intval($this->modx->getOption('mgt', $options, 16)); $mgb = intval($this->modx->getOption('mgb', $options, 16)); $mgh = intval($this->modx->getOption('mgh', $options, 9)); $mgf = intval($this->modx->getOption('mgf', $options, 9)); $orientation = $this->modx->getOption('orientation', $options, 'P'); parent::__construct($mode, $format, $default_font_size, $default_font, $mgl, $mgr, $mgt, $mgb, $mgh, $mgf, $orientation); $customFonts = $this->modx->getOption('customFonts', $options, '[]'); $customFonts = !is_array($customFonts) ? json_decode($customFonts, true) : $customFonts; if (is_array($customFonts)) { foreach ($customFonts as $f => $fs) { $this->fontdata[$f] = $fs; if (isset($fs['R']) && $fs['R']) { $this->available_unifonts[] = $f; } if (isset($fs['B']) && $fs['B']) { $this->available_unifonts[] = $f . 'B'; } if (isset($fs['I']) && $fs['I']) { $this->available_unifonts[] = $f . 'I'; } if (isset($fs['BI']) && $fs['BI']) { $this->available_unifonts[] = $f . 'BI'; } } } elseif ($this->modx->getOption('customFonts', $options, '') != '') { $this->modx->log(modX::LOG_LEVEL_ERROR, 'customFonts does not contain a JSON encoded array.', '', 'modPDF'); } $this->default_available_fonts = $this->available_unifonts; }
/** * Constructor */ public function __construct($orientation = 'P', $format = 'A4') { parent::__construct('', $format, 0, '', 15, 15, 16, 16, 9, 9, $orientation); }
public function __construct() { parent::__construct(); }
public function __construct($params = array()) { $params = $params['params'] ? $params['params'] : '"en-GB-x","A4","","",10,10,10,10,6,3'; parent::__construct($param); }