how can get the FPDF library

不打扰是莪最后的温柔 提交于 2019-12-11 05:48:43

问题


i have found some pdf file geneartion program in php. When i run it i get the following error Warning:

Warning: include(helveticab.php) [function.include]: failed to open stream: No such file or directory in E:\wamp\www\raj19\fpdf.php on line 789

Warning: include() [function.include]: Failed opening 'helveticab.php' for inclusion (include_path='.;C:\php5\pear') in E:\wamp\www\raj19\fpdf.php on line 789
FPDF error : Could not include font metric file

I think the fpdf.php is missing .I have searched on their site but i could not find the english version. can anyone provide me full link of english version?


回答1:


helveticab.php is a font definition file, which is shipped with FPDF. Get it here: http://www.fpdf.org/




回答2:


Since your code is not able to locate font library, add this line to your code.

define('FPDF_FONTPATH','fpdf/font/');



回答3:


All you have to do is to copy the entire folder, and check for "fonts" one. Go inside and search for the file you're looking for.

If nothing works. Try with $font = 'fonts/arial.ttf'; and in the "fonts" folder put the TTF file. If you don't know where to get it. Search in your explorer "fonts" and get the TTF file by dragging it to the fonts folder or copying it.

If doens't works, copy the code line where you're trying to call the font file.




回答4:


Depends on where the library is in the root directory. if Is in the same place just use $str = 'fpdf.php'; require($str); if your output is in a directory called fpdf and your php output is in another directory i.e. mydoc, you need to go up one step $str = '../fpdf.php'; if your php output is down 2 steps i.e. root/myfolder/mydoc/output.php then you need to up two steps $str = '../../fpdf/fpdf.php'; i'm assuming that you have your fpdf library in the folder root/fpdf/fpdf.php



来源:https://stackoverflow.com/questions/4658136/how-can-get-the-fpdf-library

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!