本文整理汇总了PHP中mPDF::SetDefaultBodyCSS方法的典型用法代码示例。如果您正苦于以下问题:PHP mPDF::SetDefaultBodyCSS方法的具体用法?PHP mPDF::SetDefaultBodyCSS怎么用?PHP mPDF::SetDefaultBodyCSS使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类mPDF
的用法示例。
在下文中一共展示了mPDF::SetDefaultBodyCSS方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: mPDF
//==============================================================
//==============================================================
include "../mpdf.php";
$mpdf = new mPDF('en-GB-x', 'A4', '', '', 32, 25, 27, 25, 16, 13);
$mpdf->SetDisplayMode('fullpage');
$stylesheet = file_get_contents('mpdfstyleA4.css');
$mpdf->WriteHTML($stylesheet, 1);
// The parameter 1 tells that this is css/style only and no body/html/text
// Bullets in columns are probably best not indented
$mpdf->list_indent_first_level = 0;
// 1 or 0 - whether to indent the first level of a list
$mpdf->max_colH_correction = 1.1;
$mpdf->WriteHTML($html, 2);
$mpdf->WriteHTML($loremH, 2);
// consider reducing lineheight when using columns - especially if vAligned justify
$mpdf->SetDefaultBodyCSS('line-height', 1.2);
$mpdf->SetColumns(3, 'J');
$mpdf->WriteHTML($loremH, 2);
$mpdf->SetColumns(0);
$mpdf->WriteHTML('<hr />');
$mpdf->SetColumns(2, 'J');
$mpdf->WriteHTML($loremH, 2);
$mpdf->WriteHTML('<hr />');
$mpdf->SetColumns(0);
$mpdf->WriteHTML('<hr />');
$mpdf->SetColumns(3, 'J');
$mpdf->WriteHTML($loremH, 2);
$mpdf->SetColumns(0);
$mpdf->WriteHTML('<hr />');
$mpdf->SetColumns(2, 'J');
$mpdf->WriteHTML($loremH, 2);
示例2: setFontType
/**
* Set the default document font.
*
* @param string $fontname The font name ('Times','Helvetica','Courier')
*
* @return PdfInterface The current instance
*
* @api
*/
public function setFontType(string $fontname = null) : PdfInterface
{
/**
* Font sets to be used for PDF documents:
*
* - Arial - Times - Tahoma
* - Georgia - Trebuchet - Courier
* - Lucida - Lucida-Bright - Palatino
* - Garamond - Verdana - Console
* - Monaco - Helvetica - Calibri
* - Avant-Garde - Cambria
*/
$this->setProperty('fontType', $this->getFontFamily(strtolower($fontname)));
$this->mpdf->SetDefaultBodyCSS('font-family', $this->getProperty('fontType'));
return $this;
}