我是Fpdf库的新手,我需要从smarty中的数据库创建pdf。我已经检查了数据库中的数据是否正确,当传递字体名称时,显示以下错误

Warning: in_array() expects parameter 2 to be array, null given in /var/www/html/irmt/library/class/fpdf/fpdf.php on line 526
<b>FPDF error:</b> Undefined font: helvetica B

我的代码是
            $pdf->AddPage();
            $pdf->SetFont('Arial','B',14);
            $pdf->FancyTable($result);
            $pdf->Output();

请帮我如何解决这个问题。
感谢adv

最佳答案

我认为您在pdf创建中的__construct是有问题的,请尝试使用

    require_once("fpdf.php");
    class pdf extends FPDF
    {
      function __construct()
       {
          parent::FPDF();
       }
    }

关于php - 未定义的字体: In Fpdf,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/14151317/

10-10 16:06