简体   繁体   English

MPDF 8 忽略字体配置

[英]MPDF 8 ignoring font configuration

Font configuration is completely ignored in MPDF 8.0: MPDF 8.0 中完全忽略字体配置:

$mpdf = new \Mpdf\Mpdf(['c', 'A4', '12', 'Helvetica', 25, 25, 25, 25]);

The PDF created doesn't have an Helvetica font or a 12 pt font, as it should per the manual.创建的 PDF 没有Helvetica字体或12 pt字体,因为它应该按照手册。

Whereas the following code works fine in MPDF 6.0:而以下代码在 MPDF 6.0 中工作正常:

$mpdf = new mPDF('c', 'A4', '12', 'Helvetica', 25, 25, 25, 25);

mPDF since 7.0 is used with config names as keys in the constructor. mPDF 自 7.0 起与配置名称一起用作构造函数中的

    $mpdf = new \Mpdf\Mpdf([
        'mode' => 'c', 
        'format' => 'A4', 
        'default_font_size' => '12', 
        'default_font' => 'Helvetica',
        'margin_left' => 25,
        'margin_top' => 25,
        'margin_right' => 25,
        'margin_bottom' => 25,
    ]);

see https://mpdf.github.io/reference/mpdf-functions/construct.htmlhttps://mpdf.github.io/reference/mpdf-functions/construct.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM