首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >FPDI-2.3.6“致命错误:未捕获错误:类"FPDI”未找到“(2021)

FPDI-2.3.6“致命错误:未捕获错误:类"FPDI”未找到“(2021)
EN

Stack Overflow用户
提问于 2021-04-26 22:55:29
回答 1查看 551关注 0票数 0

在正确加载后,我下载并解压缩FPDF 1.83FPDI 2.3.6

代码语言:javascript
运行
复制
<?php
require_once('fpdf183/fpdf.php');
require_once('FPDI-2.3.6/src/autoload.php');

但当我尝试使用时:

代码语言:javascript
运行
复制
<?php
require_once('fpdf183/fpdf.php');
require_once('FPDI-2.3.6/src/autoload.php');

$pdf = new FPDI();

Fatal error: Uncaught Error: Class "FPDI" not found ... on line 5

我怎么才能解决这个问题呢?我怎么才能在不使用composer的情况下使用所有函数FPDI和FPDF呢?

EN

回答 1

Stack Overflow用户

发布于 2021-04-26 23:19:55

您需要使用额外的行:use setasign\Fpdi\Fpdi;

代码语言:javascript
运行
复制
<?php
require_once('fpdf183/fpdf.php');
require_once('FPDI-2.3.6/src/autoload.php');
use setasign\Fpdi\Fpdi;

然而,在2021中用PDFI打开PDFI,你可能会得到:

Alternatively the document you're trying to import has to be resaved without the use of compressed cross-reference streams and objects by an external programm (e.g. by lowering the PDF version to 1.4).

然后setasign.com回复:We offer a commercial addon which enables FPDI to handle documents that uses these compression features. :@

https://www.setasign.com/support/faq/fpdi/error-document-compression-technique-not-supported/

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67268960

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档