如何获取FPDF库
我在 php 中找到了一些 pdf 文件生成程序。当我运行它时,出现以下错误警告:
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
我认为 fpdf.php 丢失了。我在他们的网站上进行了搜索,但找不到英文版本。谁能给我英文版的完整链接?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
helveticab.php
是一个字体定义文件,随 FPDF 一起提供。在这里获取:http://www.fpdf.org/
helveticab.php
is a font definition file, which is shipped with FPDF. Get it here:http://www.fpdf.org/
由于您的代码无法找到字体库,因此请将此行添加到您的代码中。
Since your code is not able to locate font library, add this line to your code.
您所要做的就是复制整个文件夹,然后检查“字体”之一。进去并搜索您要查找的文件。
如果什么都不起作用。尝试使用
$font = 'fonts/arial.ttf';
并在“fonts”文件夹中放入 TTF 文件。如果你不知道从哪里得到它。在资源管理器中搜索“字体”并通过将其拖到字体文件夹或复制来获取 TTF 文件。如果不起作用,请复制您尝试调用字体文件的代码行。
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.
取决于库在根目录中的位置。如果在同一个地方就使用
$str = 'fpdf.php';
要求($str);
如果你的输出位于名为 fpdf 的目录中,而你的 php 输出位于另一个目录(即 mydoc)中,则需要上一步
$str = '../fpdf.php';
如果你的 php 输出下降了 2 步,即 root/myfolder/mydoc/output.php 那么你需要上升两步 $str = '../../fpdf/fpdf.php';我假设您的 fpdf 库位于文件夹 root/fpdf/fpdf.php 中
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