dongtao4319 2019-02-05 05:49
浏览 302
已采纳

如何在FPDF中设置字体路径

I'm getting the following error:

include(/gravity/school/pdf/font/helveticab.php): failed to open stream: No such file or directory in C:\xamp\htdocs\gravity\school\pdf\fpdf.php on line 1144

Can anyone tell me how to set the fontpath?

  • 写回答

1条回答 默认 最新

  • dongzhi7763 2019-02-05 06:23
    关注

    You can place font file anywhere in your project folder, the best way to place font file is fpdf/fonts, Where fpdf is your library folder which you are using to generate PDFs. Then after set the fonts as below:

    define('FPDF_FONTPATH','/Path/to/font');
    require('fpdf.php');
    
    // Arial bold 14
    $pdf->SetFont('Arial','B',14);
    

    You can refer official doc for more information: SetFont FPDF

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 PADS Logic 原理图
  • ¥15 PADS Logic 图标
  • ¥15 电脑和power bi环境都是英文如何将日期层次结构转换成英文
  • ¥20 气象站点数据求取中~
  • ¥15 如何获取APP内弹出的网址链接
  • ¥15 wifi 图标不见了 不知道怎么办 上不了网 变成小地球了