nicholasmr / obblm

Automatically exported from code.google.com/p/obblm
26 stars 54 forks source link

FPDF error: Some data has already been output, can't send PDF file #720

Closed Draven2001 closed 8 years ago

Draven2001 commented 8 years ago

Hi,

Installed latest obblm and cannot get a PDF roster up. The below error message comes up.

case 'I': //Send to standard output if(ob_get_length()) $this->Error('Some data has already been output, can\'t send PDF file'); if(php_sapi_name()!='cli') { //We send to a browser header('Content-Type: application/pdf'); if(headers_sent()) $this->Error('Some data has already been output, can\'t send PDF file2'); header('Content-Length: '.strlen($this->buffer)); header('Content-Disposition: inline; filename="'.$name.'"'); header('Cache-Control: private, max-age=0, must-revalidate'); header('Pragma: public'); ini_set('zlib.output_compression','0'); } echo $this->buffer; break;

Any help or pointers would be appreciated

Thanks

Draven2001 commented 8 years ago

If it helps. Ive seen this issue raised before but the solutions appear to be add ob_clean() which is already in fpdf.php?

In error log:

ob_clean(): failed to delete buffer. No buffer to delete in /home/TEST/modules/pdf/fpdf.php on line 994 [30-Apr-2016 14:20:21 UTC] PHP Warning: Cannot modify header information - headers already sent by (output started at /home/TEST/modules/pdf/fpdf.php:994) in /home/TEST/modules/pdf/fpdf.php on line 1018

Draven2001 commented 8 years ago

Fixed by commenting out ob_clean in fdpf.php

Snippet: function Output($name='', $dest='') { //ob_clean(); //Output PDF to some destination if($this->state<3) $this->Close(); $dest=strtoupper($dest); if($dest=='')