问题
I am getting FPDF Error while trying to OutPut
require('cons.php');
$fpd = new fpdfx();
$fpd->AddPage();
$fpd->SetFont('Arial','B',16);
$fpd->Cell(40,10,'Hello World!');
$fpd->Output();
and i have few codes in cons.php
error_reporting(E_ERROR | E_PARSE); //For Error Reporting
session_start();
setlocale(LC_MONETARY, 'da_DK');
set_time_limit(0);
define("DBHOST","XXX");
define("DBNAME","XXX");
define("DBUSER","XXX");
define("DBPASS","XXX");
define("TODAYSDATE",date('d-m-Y', strtotime("+4 months")));
define("UPDATEDATE",date('d-m-Y', strtotime("+5 months")));
define("LanguageFilesURL",'XXX');
global $instance;
require("inc/Email-class.php");
require("inc/database_class.php");
email class have email functionality with some email functions
here is my Email Class details
require("fpdf/fpdf.php");
class fpdfx extends FPDF
{
}
class Email_class
{
}
when i am trying to get some output its shows
FPDF error: Some data has already been output, can't send PDF file
回答1:
Try to comment out the $fpd->Output(); and see if you got any notice or other data sent sent to the output.
If not, dig into the Output() method and use die(); until you find what puts some data out!
来源:https://stackoverflow.com/questions/18893764/fpdf-error-some-data-has-already-been-output-by-using-fpdf