Patient Report Download PDF - Fatal Error TCPDF "Some Data has Already Been Output" - Ideas?

We’re getting an error when we try to use patient reports “download to PDF”. We’re getting the following error:

Fatal error: Uncaught Exception: TCPDF ERROR: Some data has already been output, can’t send PDF file in C:\xampp\htdocs\OpenEMR\library\html2pdf\vendor\tecnickcom\tcpdf\tcpdf.php:2927 Stack trace: #0
C:\xampp\htdocs\OpenEMR\library\html2pdf\vendor\tecnickcom\tcpdf\tcpdf.php(7643): TCPDF->Error(‘Some > data has a…’) #1 C:\xampp\htdocs\OpenEMR\library\html2pdf\html2pdf.class.php(395): TCPDF-Output(‘report.pdf’, ‘D’) #2 C:\xampp\htdocs\OpenEMR\interface\patient_file\report\custom_report.php(808): HTML2PDF->Output(‘report.pdf’, ‘D’) #3 {main} thrown in C:\xampp\htdocs\OpenEMR\library\html2pdf\vendor\tecnickcom\tcpdf\tcpdf.php on line 2927

We are using XAMPP hosted, v5.0.0, xampp control panel v3.2.2.

I did a little digging on the error , but didn’t find anything specific to this. Most of the suggestions on this are about TCPDF debugging, and generally indicate there’s a bug in the PDF generation code. I’m assuming this feature works for other users, since I can’t find any OpenEMR logs with an similar problem. Ideas?

Thanks!

This type of error can be caused by a header being sent after some output to buffer. Check if php settings have output_buffering = On.

Hi @MCONDON ,
Also ensure you have the most recent patch installed:
http://www.open-emr.org/wiki/index.php/OpenEMR_Patches
(note this patch 1 fixes a bug in this and a future patch 2 soon to be released also fixes a bug in the vitals form pdf output in this report)
-brady

Thanks @Brady.Miller, @sjpadgett -
Ended up needing both the new patch, and disabling Output_Buffering. We’re up and running now.

-Mike

1 Like