最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

php - how can get the FPDF library - Stack Overflow

programmeradmin2浏览0评论

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?

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?

Share Improve this question asked Jan 11, 2011 at 13:30 magnamagna 2874 gold badges5 silver badges13 bronze badges 4
  • 1 Your error says Failed opening 'helveticab.php' that one is probably missing – Pekka Commented Jan 11, 2011 at 13:32
  • You are mis-interpreting the error message; fpdf.php exists. The file that is missing is helveticab.php – Srisa Commented Jan 11, 2011 at 13:33
  • @srisa @pekka ya you are saying correct but problem is in that .php file there is no response at all if i click .pdf file only it goes what can i do for .php on browser – magna Commented Jan 11, 2011 at 13:41
  • you can get it from any print invoice wp free plugin in worst case , most of them are using fpdf – mujuonly Commented Jul 24, 2016 at 16:14
Add a ment  | 

4 Answers 4

Reset to default 2

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

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

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

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.

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

发布评论

评论列表(0)

  1. 暂无评论