$pdf_name=basename($_SERVER['REQUEST_URI']);
$pdf_dir=registry("DOC_ROOT")."test/". $csrUid. "/" . $pdf_name;
if (!file_exists($pdf_dir)) {
die ("文件不存在!") ;
}
//$pdf_dir = http://xxxx.com/test/test-2015/download.pdf
header("Content-type: application/pdf");
readfile($pdf_dir); // 1
exit;
像上面所述,// 1 处输出在页面输出了pdf内容,但是页面的title没有变,我现在想把这个输出pdf的页面title改为$pdf_name的值,用了ob_start()/ob_end_flush()/echo "<title>$pdf_name</title>"; ,还是失败了,不能改变这个title。
求解该怎么书写呢?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
欢迎选择我的课程,让我们一起见证您的进步~~