我想将 pdf 内联显示到 iframe 中。它适用于 Chrome,但不适用于 Firefox(最新)。
HTML
<iframe src="/3.pdf"></iframe>
服务器 HTTP 响应(参见 content-disposition: inline)
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
vary: Origin
access-control-allow-credentials: true
content-disposition: inline; filename=3.pdf
content-type: application/pdf
date: Fri, 20 Sep 2019 10:56:36 GMT
connection: close
transfer-encoding: chunked
结果
最佳答案
您可以尝试使用嵌入或对象标签,如下所示:
<html>
<body>
<embed src="/3.pdf" width="500" height="375">
</body>
</html>
关于html - Firefox 不显示内联 pdf,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58027111/