Pages

Tuesday, July 3, 2012

TCPDF ERROR:- Some data has been already output, can't send pdf file

Add the Following code by your output() function call

 ob_start();  
 $tcpdf->output($filename, $output_dest);  
 ob_end_flush();  

16 comments:

  1. Thank you very much indeed - had spent a fair bit of time trying to sort this out - all other suggestions via google failed

    ReplyDelete
    Replies
    1. You must be using output function of TCPDF class to send file contents just above and below that call ob_start() and ob_end_flush()

      See this TCPDF doc for more on this function

      http://www.tcpdf.org/doc/code/classTCPDF.html#a3d6dcb62298ec9d42e9125ee2f5b23a1

      Delete
  2. Final, here I got the solutions of problems. thanks for helping.php web development

    ReplyDelete
    Replies
    1. You must be using output function of TCPDF class to send file contents just above and below that call ob_start() and ob_end_flush()

      See this TCPDF doc for more on this function

      http://www.tcpdf.org/doc/code/classTCPDF.html#a3d6dcb62298ec9d42e9125ee2f5b23a1

      Delete
  3. Replies
    1. where i have to add these lines?

      Delete
    2. Hi Shyam

      You must be using output function of TCPDF class to send file contents just above and below that call ob_start() and ob_end_flush()

      See this TCPDF doc for more on this function

      http://www.tcpdf.org/doc/code/classTCPDF.html#a3d6dcb62298ec9d42e9125ee2f5b23a1

      Delete
    3. You must be using output function of TCPDF class to send file contents just above and below that call ob_start() and ob_end_flush()

      See this TCPDF doc for more on this function

      http://www.tcpdf.org/doc/code/classTCPDF.html#a3d6dcb62298ec9d42e9125ee2f5b23a1

      Delete
  4. Replies
    1. Hi Akuseru

      I think we need this to clear default HTML headers from output buffers so that we can send pdf headers

      Delete
  5. i am create pdf file but i can't be opened.....

    ReplyDelete