简体   繁体   English

FPDF错误:使用FPDF已经输出了一些数据

[英]FPDF error: Some data has already been output by using FPDF

I am getting FPDF Error while trying to OutPut 尝试输出时出现FPDF错误

    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 而且我在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 FPDF错误:已经输出了一些数据,无法发送PDF文件

Try to comment out the $fpd->Output(); 尝试注释掉$ 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(); 如果没有,请深入到Output()方法并使用die();。 until you find what puts some data out! 直到找到什么数据出来!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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