当前位置: 首页>>代码示例>>PHP>>正文


PHP mPDF::__construct方法代码示例

本文整理汇总了PHP中mPDF::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::__construct方法的具体用法?PHP mPDF::__construct怎么用?PHP mPDF::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在mPDF的用法示例。


在下文中一共展示了mPDF::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: __construct

 /**
  * 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;
     // }
 }
开发者ID:patricmutwiri,项目名称:joomla-pdf-document-view,代码行数:35,代码来源:mpdf.php

示例2:

 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();
 }
开发者ID:KingsleyGU,项目名称:osticket,代码行数:12,代码来源:class.pdf.php

示例3: __construct

 /**
  * 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();
 }
开发者ID:swanghyro,项目名称:Virtuemart2-all-in-one-joomla3,代码行数:22,代码来源:mpdf.php

示例4: __construct

 /**
  * 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);
 }
开发者ID:andryluthfi,项目名称:annotation-tools,代码行数:22,代码来源:PDFWriter.php

示例5: array

 /**
  * 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;
 }
开发者ID:Jako,项目名称:PDFResource,代码行数:52,代码来源:modpdf.class.php

示例6: __construct

 /**
  * Constructor
  */
 public function __construct($orientation = 'P', $format = 'A4')
 {
     parent::__construct('', $format, 0, '', 15, 15, 16, 16, 9, 9, $orientation);
 }
开发者ID:Cloudrexx,项目名称:cloudrexx,代码行数:7,代码来源:PdfDocument.class.php

示例7: __construct

 public function __construct()
 {
     parent::__construct();
 }
开发者ID:NimzyMaina,项目名称:sma,代码行数:4,代码来源:Pdf.php

示例8: __construct

 public function __construct($params = array())
 {
     $params = $params['params'] ? $params['params'] : '"en-GB-x","A4","","",10,10,10,10,6,3';
     parent::__construct($param);
 }
开发者ID:sururbadrus,项目名称:charismasimrs,代码行数:5,代码来源:Pdf.php


注:本文中的mPDF::__construct方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。