Prestashop PDF Download Error

Prestashop PDF Download Error

If you got error while downloading pdf file in Prestashop
Error : TCPDF ERROR: Some data has already been output to browser, can't send PDF file
First of all check the below line of code in classes/pdf/PDF.php in your Prestashop
ob_clean(); or ob_end_clean(); is there
if ($render)
{
  if (ob_get_level() && ob_get_length() > 0) 
  {
  ob_clean();
  }
  return $this->pdf_renderer->render($this->filename, $display);
}
and try to Download pdf file.
If it's not working just add below highlighted line of code inside the constructor top in classes/pdf/PDF.php __constructor() function .
ob_start();
save file and download your pdf again.

Comments

Popular posts from this blog

Prestashop Create Admin Controller inside Admin Folder

Prestashop Pass Controller Variables To TPL

Prestashop Admin Controller get Access Denied Error