【发布时间】:2016-01-20 04:17:01
【问题描述】:
header("Content-Length: " . filesize ('theme/assets/pdf/ci.pdf' ) );
header("Content-type: application/pdf");
header("Content-disposition: attachment;
filename=".basename('theme/assets/pdf/ci.pdf'));
header('Expires: 0');
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
$filepath = readfile('theme/assets/pdf/ci.pdf');
嗨朋友们,我有这种类型的代码。我的要求是我必须在浏览器中显示加载的 pdf(在浏览器中打开 pdf),但现在 pdf 已下载到硬盘。相反,我想在浏览器中查看文件。
【问题讨论】:
-
你在用dompdf吗
-
@AdarshMPallickal 不,我没有使用它
-
使用内联代替附件
-
@AdarshMPallickal 是的,它的工作非常感谢大家
-
@AdarshMPallickal 你能告诉我如何将这个加载的 PDF 转换成图像
标签: php codeigniter fpdf