本文整理汇总了PHP中Spipu\Html2Pdf\Html2Pdf::setDefaultFont方法的典型用法代码示例。如果您正苦于以下问题:PHP Html2Pdf::setDefaultFont方法的具体用法?PHP Html2Pdf::setDefaultFont怎么用?PHP Html2Pdf::setDefaultFont使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spipu\Html2Pdf\Html2Pdf
的用法示例。
在下文中一共展示了Html2Pdf::setDefaultFont方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: dirname
/**
* Html2Pdf Library - example
*
* HTML => PDF convertor
* distributed under the LGPL License
*
* isset($_GET['vuehtml']) is not mandatory
* it allow to display the result in the HTML format
*
* @package Html2pdf
* @author Laurent MINGUET <webmaster@html2pdf.fr>
* @copyright 2016 Laurent MINGUET
*/
require_once dirname(__FILE__) . '/../vendor/autoload.php';
use Spipu\Html2Pdf\Html2Pdf;
use Spipu\Html2Pdf\Html2PdfException;
// get the HTML
ob_start();
require dirname(__FILE__) . '/res/exemple00.php';
$content = ob_get_clean();
// convert to PDF
try {
$html2pdf = new Html2Pdf('P', 'A4', 'fr');
$html2pdf->setDefaultFont('Arial');
$html2pdf->writeHTML($content, isset($_GET['vuehtml']));
$html2pdf->Output('exemple00.pdf');
} catch (Html2PdfException $e) {
echo $e;
exit;
}
示例2: _prepareSubObj
/**
* prepare self::$_subobj (used for create the sub Html2Pdf objects
*
* @access protected
*/
protected function _prepareSubObj()
{
$pdf = null;
// create the sub object
self::$_subobj = new Html2Pdf($this->_orientation, $this->_format, $this->_langue, $this->_unicode, $this->_encoding, array($this->_defaultLeft, $this->_defaultTop, $this->_defaultRight, $this->_defaultBottom));
// init
self::$_subobj->setTestTdInOnePage($this->_testTdInOnepage);
self::$_subobj->setTestIsImage($this->_testIsImage);
self::$_subobj->setDefaultFont($this->_defaultFont);
self::$_subobj->parsingCss->css =& $this->parsingCss->css;
self::$_subobj->parsingCss->cssKeys =& $this->parsingCss->cssKeys;
self::$_subobj->extensions = $this->extensions;
// clone font from the original PDF
self::$_subobj->pdf->cloneFontFrom($this->pdf);
// remove the link to the parent
self::$_subobj->parsingCss->setPdfParent($pdf);
}