FPDF错误:无法包含字体指标文件 [英] FPDF error: Could not include font metric file
问题描述
我有一个由别人完成的应用程序,现在我被要求调查一个问题.
I have a app which was done by someone else and now i am asked to look into one issue.
生成pdf报告时,将引发错误.此应用使用FPDF生成PDF
When a pdf report is generated it throws an error. This app uses FPDF to generate the PDF
FPDF error: Could not include font metric file
更早之前,它引发了以下错误
Earlier it was throwing the following error
Warning: FPDF::include(helveticab.php) [function.FPDF-include]: failed to open stream: No such file or directory
Warning: FPDF::include() [function.include]: Failed opening 'helveticab.php' for inclusion
FPDF error: Could not include font metric file
此问题通过在helveticab.php中包含一个字体文件夹以及与其他字体相关的其他php文件来解决.
This was resolved by including a font folder with helveticab.php and other php files related to other fonts
但是错误FPDF错误:无法包含字体指标文件. 在网上搜索的可能原因是
But the Error FPDF error: Could not include font metric file is still there. On searching the net the possible reasons were
-
字体目录丢失
font directory missing
没有对字体文件的访问权限.
Doesnt have access permissions for the font files.
我不确定需要对字体文件夹或文件夹中的文件授予什么权限. 在这方面的任何帮助都会有很大帮助.
I am not sure what permission need to given to the font folder or files in the folder. Any help in this regard would be of great help.
推荐答案
我遇到了同样的问题.问题是带有所有字体的文件夹的路径不正确.因此,我在PHP文件中添加了更新的以下行,以反映具有所有字体的文件夹的正确路径.
I had the same issue. The issue was the path was incorrect to the folder with all of the fonts. So, I added updated the following line in the PHP file to reflect the correct path to the folder with all of the fonts.
define('FPDF_FONTPATH','class/fpdf_font/');
define('FPDF_FONTPATH','class/fpdf_font/');
因此,请仔细检查此行定义的路径,它应该可以正常工作.
So, double check the path that this line defines, and it should work fine.
这篇关于FPDF错误:无法包含字体指标文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!