How to Edit Existing pdf using fpdf Library in PHP ?

Have the feeling that everybody is staring at you in the other forums? Then look here, in this forum nobody does care what you say ;-)

Moderator: Project members

Locked
Message
Author
harish24
500 Command not understood
Posts: 1
Joined: 2015-10-19 10:40
First name: Harish
Last name: Pal

How to Edit Existing pdf using fpdf Library in PHP ?

#1 Post by harish24 » 2015-10-19 10:44

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:

Code: Select all

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 questions and Answers related to this issue but I am unable to get satisfactory solutions. Hope this forum help me out for the same issue.
Last edited by boco on 2015-10-19 11:52, edited 1 time in total.
Reason: Possible Spam removed.

User avatar
boco
Contributor
Posts: 25109
Joined: 2006-05-01 03:28
Location: Germany

Re: How to Edit Existing pdf using fpdf Library in PHP ?

#2 Post by boco » 2015-10-19 11:53

That doesn't have anything to do with FTP.

Unless that was a spamming attempt, you might better ask that in a PHP forum.
### BEGIN SIGNATURE BLOCK ###
No support requests per PM! You will NOT get any reply!!!
FTP connection problems? Do yourself a favor and read Network Configuration.
FileZilla connection test: https://filezilla-project.org/conntest.php
### END SIGNATURE BLOCK ###

Locked