DART/Angulardart Chrome Packaged App 中是否有 PDF 查看器? [英] Is there a PDF viewer to be used in a DART/Angulardart Chrome Packaged App ?

查看:36
本文介绍了DART/Angulardart Chrome Packaged App 中是否有 PDF 查看器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试找到一个合适的 PDF 查看器,以便在我的 Chrome 打包应用程序中简单地显示 PDF URL(外部)/或文件(在为外部 URL 创建 blob 之后).尝试了各种东西,webview/sandbox 页面和使用 pdf.js.但到目前为止还没有运气.我能够第一次让 PDF 与 webview 一起显示,但无法动态更改 webview 的 src;因为我认为这有问题.是否有人在 chrome 打包应用程序中显示动态外部 PDF URL/如何?

I am trying to find a suitable PDF viewer to simply display PDF URLs ( external ) / or files ( after creating blobs to the external URLs) in my Chrome packaged app. Tried various things , webview/sandbox pages and using pdf.js. but no luck so far. I am able to get the PDF show up with the webview for the first time but not able to dynamically change the webview's src; as I believe there is an issue with that. Is there anyone displaying dynamic external PDF URLs in a chrome packaged app / how ?

推荐答案

我最终使用了使用 chrome 的默认查看器加载 PDF 的 webview 元素,但是如果我确实显示 ="none" 并显示 ="block",它遇到 CSP 安全问题,因此我将 PDF 窗口移出可见状态,并在动态更新 src 链接后将其恢复.

I ended up using webview element which loads the PDF using chrome's default viewer, but if I do display ="none", and display ="block", it encounters CSP security issues, so as work around I move the PDF window out of visible and bring it back after updating the src link dynamically.

这篇关于DART/Angulardart Chrome Packaged App 中是否有 PDF 查看器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆