diff --git a/libraries/tcpdf/tcpdf.php b/libraries/tcpdf/tcpdf.php index 3d134b61d..a6b707ac2 100644 --- a/libraries/tcpdf/tcpdf.php +++ b/libraries/tcpdf/tcpdf.php @@ -2996,7 +2996,7 @@ if(!class_exists('TCPDF', false)) { case 'D': { //Download file if(ob_get_contents()) { - $this->Error(ob_get_contents().'Some data has already been output, can\'t send PDF file'); + $this->Error('Some data has already been output, can\'t send PDF file'); } if(isset($_SERVER['HTTP_USER_AGENT']) && strpos($_SERVER['HTTP_USER_AGENT'],'MSIE')) { @@ -3007,6 +3007,7 @@ if(!class_exists('TCPDF', false)) { if(headers_sent()) { $this->Error('Some data has already been output to browser, can\'t send PDF file'); } + header('Content-Type: application/pdf'); header('Content-Length: '.strlen($this->buffer)); header('Content-disposition: attachment; filename="'.$name.'"'); echo $this->buffer;