在 webview 中打开一个 pdf 文件. [英] Open a pdf file inside a webview.

查看:33
本文介绍了在 webview 中打开一个 pdf 文件.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用,其中我在网页视图中呈现的网页上放置了按钮.

I have an app where I've button on a webpage that is rendered inside a webview.

现在点击按钮,下载一个 pdf 文件,然后需要在同一个 webview 中打开相同的文件.

Now on click of button , a pdf file gets downloaded , and the same would then need to be opened inside the same webview.

推荐答案

将下载侦听器附加到 web 视图并更改 url 如下..

attach a download listener to the web view and change the url as follows..

http://docs.google.com/gview?embedded=true&url=http://www.abc.com/xxxxxyyyyyxz.pdf"

这是一个用来打开pdf而不下载它的链接...

it's a link used to open pdf without downloading it...

希望它能解决您的问题..

I hope it solves your problem..

这篇关于在 webview 中打开一个 pdf 文件.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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