html - pdf 未在本地目录的 html 中显示
问题描述
我正在尝试使用本地目录中的 html 在 Web 上查看 pdf。
<embed src="file:///C:/others/hello.pdf" width="250" height="375" type='application/pdf'/>
但是浏览器(chrome)说:
Blocked http://localhost:8081 from loading file:///C:/others/hello.pdf. Refused to load a local file in a non-local page for security reasons.
但是当我尝试从网页 url 查看 pdf 时,它可以工作。
解决方案
This might be of help. allowing local files access on chrome
推荐阅读
- python - 这个f在这句话中是什么意思?
- c# - 如何在 SQL 中使用 C# 创建列
- javascript - 如果用户无权访问该功能,如何禁用 onclick 功能?
- python-3.x - Azure-sdk-for-python AKS-如何在 AKS 上升级 kubernetes
- swift - AssetReader/AssetWriter - CMSampleBuffer 和 CALayer
- javascript - 从函数 node.js 访问变量数据
- regex - 正则表达式来分隔时间并用分隔符替换它
- c++ - 如果插入了正确的输入,则终止程序
- julia - 如何在 Windows 上的 Julia REPL 中清除屏幕
- python - 我可以在我的代码中添加什么以在输出中显示排序所做的所有动作?