0

I am trying to read a pdf file, which contains images and formatting and adding new page at the end of that pdf file and then setting pdf password using mpdf in codeigniter 4.1.3 and mpdf version > 8.0.

Plain PDF files without images works completely fine using code below. Can anyone help here?

error as follows -

ErrorException #1
Uncaught CodeIgniter\HTTP\Exceptions\HTTPException: Unknown HTTP status code provided with no message: 267 in /Applications/MAMP/htdocs/projectname/system/HTTP/ResponseTrait.php:548
Stack trace:
#0 /Applications/MAMP/htdocs/projectname/system/HTTP/ResponseTrait.php(548): CodeIgniter\HTTP\Exceptions\HTTPException::forUnkownStatusCode(267)
#1 /Applications/MAMP/htdocs/projectname/system/Debug/Exceptions.php(318): CodeIgniter\HTTP\Response->setStatusCode(267)
#2 [internal function]: CodeIgniter\Debug\Exceptions->exceptionHandler(Object(setasign\Fpdi\PdfParser\CrossReference\CrossReferenceException))
#3 {main}
$this->mpdf->SetDocTemplate($source, true);
$this->mpdf->SetProtection(array('print', 'modify'), '123456', '123456');
$this->mpdf->AddPage();
$this->mpdf->WriteHTML('');
$this->mpdf->Output(APPPATH . "../public/files/" . $fileName, 'F'); 
    
Finwe
  • 6,372
  • 2
  • 29
  • 44
Heena Manglani
  • 356
  • 2
  • 11
  • How did you add images to PDF? from form upload or in the resource folder? – Abdulla Nilam Sep 07 '21 at 04:32
  • @AbdullaNilam Well, I found out that fpdf cannot read files with version greater than 1.4 - so looking for a solution to read files stored with 1.4 and more now. Do you have some idea around it? Images with version <=1.4 doesn't seems a problem. – Heena Manglani Sep 07 '21 at 09:32
  • @AbdullaNilam We ended up buying a license to read PDF version more than 1.4! Setasign is the name of the provider and now it works well :) – Heena Manglani Jan 27 '22 at 19:00
  • Happy to hear "it works well". Good Luck <3 – Abdulla Nilam Jan 31 '22 at 04:56

0 Answers0