Support the ongoing development of Laravel.io →
Configuration Input Installation

By the help of FPDI library, I tried to write some exsiting pdf files but able to wirte only single page of pdf. Below is my code:

require_once '../includes/fpdf/fpdf.php'; require_once '../includes/fpdf/fpdi.php'; $pdf = new FPDI(); $pageCount = $pdf->setSourceFile("contractFinalTrans.pdf"); $tplIdx = $pdf->importPage(1); $pdf->addPage(); $pdf->useTemplate($tplIdx, 10, 10, 200); //set position in pdf document // now write some text above the imported page //$pdf->SetFont('Arial'); $pdf->SetFontSize(10); $pdf->SetTextColor(255,0,0); $pdf->SetXY(50, 50); $pdf->Write(0, "page 1");///print this output $pdf->SetAutoPageBreak(true,22); $pdf->addPage(); $tplIdx = $pdf->importPage(2); //$pdf->addPage(); $pdf->useTemplate($tplIdx, 10, 10, 200); //set position in pdf document // now write some text above the imported page //$pdf->SetFont('Arial'); $pdf->SetFontSize(10); $pdf->SetTextColor(255,0,0); $pdf->SetXY(100 , 100); $pdf->Write(0, "page 2"); $pdf->Output();

Can anyone suggest me how to Edit Existing multiple pdf using fpdf Library in PHP I have explored many php developer forum related to this issue but I am unable to get satisfactory solutions. Hope this forum help me out for the same issue.

Last updated 2 years ago.
0

hi, i have the same problem. Can you show me how can i install FPDI on Laravel 5.1? thanks

Last updated 9 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

manoj77 manoj77 Joined 26 Aug 2015

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2025 Laravel.io - All rights reserved.