php - 如何在视图中显示存储中的pdf文件
问题描述
我对如何在刀片中显示 pdf 文件进行了研究。我找到了这个答案。但是我应该在刀片中做什么来显示文件?
$filename = 'test.pdf';
$path = storage_path($filename);
return Response::make(file_get_contents($path), 200, [
'Content-Type'
=> 'application/pdf',
'Content-Disposition' => 'inline; filename="'.$filename.'"'
我如何在刀片中显示结果(pdf)?
解决方案
<iframe src="path_of_pdf_file" width ="100%" height="600px"></iframe>
推荐阅读
- python - Python中的数据类型更改:使用删除数据类型更改删除行时
- genetic-programming - 在遗传编程 DEAP 中,评估停留在局部最优。如何防止 GP 收敛到局部最优?
- java - 无法正确计算循环
- c# - 在 Microsoft.WindowsAzure.Storage.Shared.Protocol.HttpResponseParsers.ProcessExpectedStatusCodeNoException[T] 接收 404
- angular - 为什么我们需要绑定到 SRC 才能从 TypeScript 文件中获取图像?
- c++ - 比较 std::tuple_element 和 decltype(std::get) 时,std::is_same 返回 false
- laravel - 如何删除 Laravel Auth Hashing(用 mysql 散列替换它)?
- tfs - 如何使用 REST API 修改工作项的 BoardColumn 字段
- php - 如何在 Avada 子主题功能中覆盖 Fusion Element Container?
- c# - 通过 AD 服务主体进行 Azure SQL 身份验证