如何在没有错误或警告的情况下将PDF嵌入到chrome中

时间:2013-10-16 17:53:48

标签: html http google-chrome pdf http-headers

我正在构建一个界面来查看一长串PDF文档(在Chrome中),这些文档都是<embed>个。

<embed width="100%" height="100%" name="plugin" src="http://example.com/path/to/pdf/11749" type="application/pdf">

它工作正常,但控制台填满了这个(每个嵌入式PDF一个):

Resource interpreted as Document but transferred with MIME type application/pdf: "http://example.com/path/to/pdf/11749".

我之前看过这个问题,但从未得到充分回答。我不想安装浏览器插件或强制下载。

1 个答案:

答案 0 :(得分:2)

为什么不使用http://mozilla.github.io/pdf.js/

这不仅仅是浏览器插件。检查示例。实施相当简单