作者热门文章
- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
我有一个由其他人开发的应用程序,现在我被要求调查一个问题。
生成 pdf 报告时会抛出错误。此应用程序使用 FPDF 生成 PDF
FPDF error: Could not include font metric file
早些时候它抛出以下错误
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 文件的字体文件夹解决的
但 Error FPDF 错误:无法包含字体度量文件仍然存在。网上查了一下可能的原因是
字体目录丢失
没有字体文件的访问权限。
我不确定字体文件夹或文件夹中的文件需要什么权限。在这方面的任何帮助都会有很大帮助。
最佳答案
我遇到了同样的问题。问题是包含所有字体的文件夹的路径不正确。因此,我在 PHP 文件中添加了更新的以下行,以反射(reflect)包含所有字体的文件夹的正确路径。
define('FPDF_FONTPATH','class/fpdf_font/');
因此,请仔细检查此行定义的路径,它应该可以正常工作。
关于php - FPDF 错误 : Could not include font metric file,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6521000/
我是一名优秀的程序员,十分优秀!