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

ⅰ亾dé卋堺 提交于 2019-12-24 19:10:00

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!