在正确加载后,我下载并解压缩FPDF 1.83
和FPDI 2.3.6
:
<?php
require_once('fpdf183/fpdf.php');
require_once('FPDI-2.3.6/src/autoload.php');
但当我尝试使用时:
<?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呢?
发布于 2021-04-26 23:19:55
您需要使用额外的行:use setasign\Fpdi\Fpdi;
<?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/
https://stackoverflow.com/questions/67268960
复制相似问题