FPDF error: This document (testcopy.pdf) probably

2020-02-07 19:19发布

I am running the following code and giving me this error : FPDF error: This document (testcopy.pdf) probably uses a compression technique which is not supported by the free parser shipped with FPDI. I used another pdf named test.pdf and that works fine but it is giving me error in testcopy.pdf.

I think this is parser problem. Anyone know any other parser that can be used with fpdf to avoid this error?

My code:

require('fpdf17/fpdf.php'); 
require('fpdf17/fpdi.php'); 
// initiate FPDI 
$pdf = new FPDI(); 
while (ob_get_level())
ob_end_clean();
header("Content-Encoding: None", true);
// set the sourcefile 
$pagecount = $pdf->setSourceFile('testcopy.pdf');

I want to split pdf in two pdfs and want to attach both pdfs in file attachments field.How to save pdf to server. Can it be possible with fpdf?

标签: php fpdf fpdi
7条回答
Juvenile、少年°
2楼-- · 2020-02-07 19:52

The file needs to be PDF 1.4 (Acrobat 5) or lower. If you have Adobe Acrobat Pro you can change this with Document->Decrease File Size.

查看更多
登录 后发表回答