You have die(); in your code and that is killing the page 😆
Just kidding. I'm having hard time figuring what is working and what is not from your explanation and code sample. Can you explain again?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i installed the setasign to edit pdf file.All works fine.It works as it was supposed to be work.But i change a code but i went on my old code and it is not working now saying the connection was reset.if i dd anything before the $pdf->Output() it returns the value.The problem is with pdf-Output().Please help me to solve it .My previously working code in my method is:
$pdf = new Fpdi();
// add a page
$pdf->AddPage();
// set the source file
$countPage = $pdf->setSourceFile(__DIR__."\quotation.pdf");
// import page 1
$tplIdx = $pdf->importPage(1,PdfReader\PageBoundaries::MEDIA_BOX);
// use the imported page and place it at position 10,10 with a width of 210 mm A4
//$pdf->useTemplate($tplIdx,10, 10, 100);
//return $tplIdx;
//$tempateSize = $pdf->getTemplateSize($tplIdx);
// return $tempateSize;
$pdf->useTemplate($tplIdx,0, 0,210,297);
// $pdf->useImportedPage($tplIdx,0, 0,210,297);
// now write some text above the imported page
$pdf->SetFont('Helvetica');
$pdf->SetTextColor(0, 0, 0);
$pdf->SetFontSize(15);
$pdf->SetXY(10,30);
// $pdf->Write(10,'Name:'); //first argument moves from top
$pdf->Text(10,40,"Company Name:"); //2nd argument moves from top to bottom
$pdf->Text(50,40,"Mubeen Company"); // first argument moves from let to right
$pdf->Text(10,50,"Mobile:");
$pdf->Text(50,50,"923029837061");
$pdf->Text(10,60,"Contact Person:");
$pdf->Text(50,60,"Mubeen Khan");
$pdf->Text(10,70,'Quotation');
$pdf->setFont('Arial','B',12);
// $pdf->Cell(0,80);
// move from left to right
$pdf->setY(75);
// first argument width
$pdf->cell(15); // move the cell from left to right
/**
* cell
* first argument ====> width
* second argument ====> height
* thir argument ====> Column name
* 4th argument ====> 0 means borderless 1 means with border
* 5th argument ====> column text in center or in left or in right align
*/
$pdf->Cell(80,10,'Prouct Name',1,0,'C'); // first argument width
$pdf->Cell(30,10,'Original Price',1,0,'C'); // first argument width
$pdf->Cell(30,10,'Offered Price',1,0,'C'); // first argument width
$pdf->Ln();
for($i=0;$i <= 100 ;$i++)
{
$pdf->cell(15); // move the cell from left to right
$pdf->Cell(80,10,"Some Product naem will go here Some",1,0,'L'); // first argument width
$pdf->Cell(30,10,"200",1,0,'L'); // first argument width
$pdf->Cell(30,10,"300",1,0,'L'); // first argument width
$pdf->Ln();
}
echo $pdf->Output();
die();
Now it is not working.Please help me to solve this.
Please or to participate in this conversation.