the echo statement is not running and the below script is also not running
header("HTTP/1.1 200 OK");
header("Pragma: public");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Cache-Control: private", false);
header('Content-Type: application/pdf');
header('Content-Disposition: attachment;filename="rename.pdf"'); //tell browser what's the file name
header('Cache-Control: max-age=0'); //no cache
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'PDF');
$objWriter->setSheetIndex($i);
$objWriter->save('php://output');
echo "this is not diplaying"; //code get terminated
Don't echo anything when you're sending data to php://output
with file headers.... echo sends its data to php://output
..... all you're doing is writing "this is not diplaying"
at the bottom of the file that you're sending.... and the likelihood is that it will also corrupt that file