TCPDF error

TCPDF error

by sam salt -
Number of replies: 5

 

I am using moodle 2.2 and i want to fetch some useful information of user on certificate

when i wrote this code to fetch

certificate_print_text($pdf, $x+120, $y+30, 'C', 'Helvetica', '', 14, $questionnaire->view_response($rid));

it give error
TCPDF ERROR: Some data has already been output, can't send PDF file

and certificate saved without fetching that information

Average of ratings: -
In reply to sam salt

Re: TCPDF error

by sam salt -

I had wrote my own code there for fetching data.

In reply to sam salt

Re: TCPDF error

by Mark Nelson -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Hi Sam,

Some information is being output to the browser window before the pdf is sent to the browser to be downloaded. I suspect you have an echo statement or the equivalent in your certificate type folder, or the view.php file.

More code would be helpful.

Regards,

Mark

In reply to Mark Nelson

Re: TCPDF error

by Mairsile Hourihane -

Hi Mark,

I am having the same problem on a M2.5.

The certificate was working fine when I was last adding content, but today I'm getting the TDPDF Error: some data has already been output.

Have you any suggestions as to why this error should occur on a site that has had no code changes.

Moodle version 2.5.4+, Firefox & Chrome browsers on Windows and Android.

Thanks,

Mairsile Hourihane