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

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

by Jack G -
Number of replies: 5

I think I erroneously put this under 'General Problems' first...

I've spent the last few days trying to recover from a mistake with no success. Any help is greatly appreciated.

I accidentally copied up the certificates.php file from a type folder to the lang/en_utf8 folder. After realizing that this was giving us the 'white screen of death' I replaced it with the correct file.

Now the user gets 'FPDF error: Some data has already been output, can't send PDF file' everytime they try to generate a certificate. Administrators are able to view issued certificates and see the correct certificate but the users cannot generate their own.

I've searched the forums and cannot find a fix. I'll keep looking.

Thanks - Jack

Average of ratings: -
In reply to Jack G

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

by Jack G -

Hello all (I apologize for the repeat in the General Problems category) –

The certificates are now working again. I don’t like the way this was accomplished; but, it does work.

Here’s what I did starting with my comment on line 1019 of ‘fpdf.php’:

//JHG 12/24/09: Commented out next two lines to avoid error message when generating certificate

//if(ob_get_contents())

// $this->Error('Some data has already been output, can\'t send PDF file');

The reason I don’t like this solution is that we may encounter legitimate errors in the future that we are now just going to ignore. Hopefully someone more familiar with Moodle has a better answer.

By the way…Merry Christmas and Happy New Year!

Thanks - Jack

In reply to Jack G

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

by Kaalgat - -
Hallo Jack

There can be a chance that it could be related to this issue:
http://moodle.org/mod/forum/discuss.php?d=135077

Kaalgat.
In reply to Kaalgat -

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

by Kaalgat - -
Jack

Did it work, did we save the earth?

Kaalgat.
In reply to Kaalgat -

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

by Jack G -

Sorry for the delayed response Kaalgat. I've set the forums so I don't receive all posts.

I had looked at the forum post you referred to and actually put those lines in my files. It did eliminate a couple notices I was receiving but I still had the FPDF error. The only way I got rid of it was commenting out the lines in FPDF.php.

In reply to Jack G

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

by Steven Ouellette -
Jack, I had the same error without placing files in the wrong location that you did. I have Moodle 1.9.2 (Build: 20080716)

This is the first time in a long time I have viewed the certificate function (have been recording the class that the Moodle site supports) so I can't tell when it went wacky.

Your solution resolved the problem though - and for that I thank you!