1
回声语句的其余部分保存PDF没有运行,并且下面的脚本也没有运行使用phpexcel终止脚本
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
谢谢...先生任何替代我的问题。 – kashif
是的.....当你输出一个文件到浏览器时,不会回应其他任何东西.....这不是PHPExcel特有的,它适用于任何生成或写入php://输出的文件通过PHP ....你只能发送一个内容类型到浏览器以响应一个请求 –