FPDF error: Could not include font definition file in PHP

后端 未结 6 796
刺人心
刺人心 2021-01-22 23:42

I have bunch of images and I want to generate PDF of of all those images. I am using FPDF library (version 1.7) for achieving this. But I am getting the following e

6条回答
  •  滥情空心
    2021-01-23 00:05

    Check your font path in AddFont function.

    For example:

    $fontInformation = pathinfo(WWW_ROOT . "files/files/font/file/" . $pdffile['font_file']);
    
    $fontFileName = $fontInformation['filename'] . '.php';
    
    //$pdf->fontpath = WWW_ROOT . "files/font/file/";
    
    
    $pdf->AddFont($fontInformation['filename'], '', $fontFileName);
    
    //set font for the entire document
    $pdf->SetFont($fontInformation['filename'], '', 20);
    

    This may solve your problem.

提交回复
热议问题