【问题标题】:how to display the pdf file in iframe in laravel?如何在 laravel 的 iframe 中显示 pdf 文件?
【发布时间】:2020-09-28 04:08:17
【问题描述】:

pdf 没有在 iframe 中显示如何显示 pdf 文件。

<iframe id="gen_view" src="" width="550" height="600"></iframe>

jquery 代码

 $('#gen_view').attr("src", res.path);

这个文件的响应在这里

{success: true, 
path: "/var/www/html/controlroom/storage/app/genrate_order
       /order_gen1591607597_.pdf"}

【问题讨论】:

    标签: jquery laravel iframe


    【解决方案1】:

    试试这个:

    $('#gen_view').attr("src", res.path);
    

    虽然要获得完整的浏览器支持,但您应该使用 PDF javascript 库,例如 https://github.com/mozilla/pdf.js

    【讨论】:

      猜你喜欢
      • 2013-03-03
      • 2013-02-03
      • 1970-01-01
      • 2010-12-28
      • 1970-01-01
      • 1970-01-01
      • 2012-03-31
      • 2017-11-13
      • 1970-01-01
      相关资源
      最近更新 更多