1 回答
![?](http://img1.sycdn.imooc.com/533e4d2600013fe202000200-100-100.jpg)
TA贡献1797条经验 获得超6个赞
我设法使它在 PHP 7.3 下工作。这是我在方法_beginpage 中的工作代码,我更改了这一行:
$n = sizeof($this->PageGroups)+1;
用这些线:
if (empty($this->PageGroups)) {
$n = 1;
} else {
$n = count($this->PageGroups) + 1;
}
其他最重要的事情是它必须将字体系列设置为Arial 以其他方式它不起作用并且它正在显示{nb2}。所以应该是这样的。
require 'lib/pagegroup.php';
class MYPDF extends PDF_PageGroup {
function Header() {
$this->AddFont('DejaVuSans', '', 'DejaVuSans.ttf', true);
$this->SetFont('Arial', '', 10);
$this->Cell(0, 6, 'Page '.$this->GroupPageNo().'/'.$this->PageGroupAlias(), 0, 0, 'C');
// change the font to the one you want to use in my case DajaVu
$this->SetFont('DejaVuSans', '', 16);
}
for ($i = 0; $i < 2; $i++) {
$pdf->StartPageGroup();
$pdf->AddPage();
// some other code ...
}
}
- 1 回答
- 0 关注
- 141 浏览
添加回答
举报