简体   繁体   中英

FPDF error: Some data has already been output by using FPDF

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

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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM