if(isset($_POST['hid_content'])){
$strContent = $_POST['hid_content'];//页面内容
header("X-XSS-Protection: 0;");
include dirname ( __FILE__ ) . '/../../thirdParty/mpdf/vendor/autoload.php';
$intFontSize = 10.5;
if($intContractType == 5){
$intFontSize = 9.5;
}
$defaultConfig = (new Mpdf\Config\ConfigVariables())->getDefaults();
$fontDirs = $defaultConfig['fontDir'];
$defaultFontConfig = (new Mpdf\Config\FontVariables())->getDefaults();
$fontData = $defaultFontConfig['fontdata'];
$mpdf = new \Mpdf\Mpdf(['mode' => 'utf-8',
'format' => 'A4',
'default_font_size'=> $intFontSize,
'useSubstitutions' => true,//中文支持关键
'useAdobeCJK'=>true,
'margin_left' => 0,
PHP MPDF 8.1 页面转PDF 深层使用 自定义字体设置 标签样式自定义设置等
最新推荐文章于 2024-07-01 17:45:32 发布