Currently I'm working on a PHP project. I want to generate pdf on button click but when we click on button then i get an error "FPDF error: Some data has already been output, can't send PDF file".
My code are
/**
* @version 1.0.0
* @package com_ram
* @copyright Copyright (C) 2012. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @author vineet saini
*/
// no direct access
defined('_JEXEC') or die;
?>
items) : ?>
include('fpdf.php');
$pdf=new FPDF();
$pdf->SetAutoPageBreak(false);
$pdf->AddPage();
$y_axis_initial = 8;
$pdf->SetFillColor(232,232,232);
$pdf->SetY($y_axis_initial);
$pdf->SetX(80);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Curriculum Vitae')."";
$pdf->Ln(20);
$row_height = 6;
$y_axis=50;
$y_axis = $y_axis + $row_height;
$con=mysql_connect ("localhost","root","");
mysql_select_db ("pradeep_jo17",$con);
if(@$_POST ['sel'])
{
$result=mysql_query('select * from jos_resume');
//initialize counter
$i = 0;
//Set maximum rows per page
$max = 25;
while($row = mysql_fetch_array($result))
{
//If the current row is the last one, create new page and print column title
if ($i == $max)
{
$pdf->AddPage();
//print column titles for the current page
$pdf->SetY($y_axis_initial);
$pdf->SetX(25);
$y_axis = $y_axis + $row_height;
//Set $i variable to 0 (first row)
$i = 0;
}
$name = $row['fullname'];
$address = $row['address'];
$objective = $row['objective'];
$profqualificatiion = $row['profqualification'];
$acequalificatiion = $row['acequalification'];
$workexp = $row['workexp'];
$techskills = $row['techskills'];
$hobbies = $row['hobbies'];
$strength = $row['strength'];
$achivements = $row['achivements'];
$projectdetails = $row['projectdetails'];
$personaldetails = $row['personaldetails'];
$date = $row['date'];
$signature = $row['signature'];
//$pdf->SetY($y_axis);
$pdf->SetX(10);
//$pdf->Cell(20,6,$code,1,0,'L',1);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$name);
$pdf->Ln(5);
$pdf->Cell(20,6,$address);
$pdf->Ln(8);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Career Objective');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$objective);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Professional Qualification');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$profqualificatiion);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Academic Qualification');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$acequalificatiion);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Working Experience');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$workexp);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Technical Skills');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$techskills);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Hobbies');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$hobbies);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Strength');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$strength);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Achievements');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$achivements);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Project Details');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$projectdetails);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Personal Details');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$personaldetails);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Date');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$date);
$pdf->Ln(5);
$pdf->SetFont('Arial','B',12);
$pdf->Cell(30,20,'Signature');
$pdf->Ln(12);
$pdf->SetFont('Arial','I',12);
$pdf->Cell(20,6,$signature);
//Go to next row
//$y_axis = $y_axis + $row_height;
$i = $i + 1;
}
}
//Send file
$pdf->Output();
?>
pagination->getPagesCounter(); ?>
pagination->getPagesLinks(); ?>
---------------------------------------------------------------------
Please resolve my problem anyone ? Please help me ?
Thanks.

Replies
Know the answer? Post it — somebody with the same question will find it here.