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


Solve:

Add the function ob_end_clean(); before call the Output function. It worked for me within a custom Wordpress function!
ob_end_clean();
$pdf->Output($pdf_name, 'I');
reference link: https://stackoverflow.com/questions/16011050/tcpdf-error-some-data-has-already-been-output-cant-send-pdf-file

Did you find this article useful?