我有一个应用程序,我在一个网页上按下按钮,该网页在网络视图中呈现。
现在点击按钮,下载一个pdf文件,然后需要在同一个网络视图中打开该文件。
我有一个应用程序,我在一个网页上按下按钮,该网页在网络视图中呈现。
现在点击按钮,下载一个pdf文件,然后需要在同一个网络视图中打开该文件。
将下载侦听器附加到web视图,并按如下方式更改url。。
“https://docs.google.com/gview?embedded=true&;网址=https://www.实例.com/xxxxxyyyyyxz.pdf“
实例
这是一个用来打开pdf而不下载的链接。。。
我希望它能解决你的问题。。
我发现google查看器似乎可以在android浏览器中查看在线PDF文件。您可以建立一个指向PDF的链接,以便在查看器中显示。不过,我还没有尝试在WebView
中这样做。
更新
The link is dead, there is an explanation of how to get the functionality to still work at this link.
In case this link also dies, here is the relevant section:
虽然该页面在重定向到谷歌文档/驱动器时不再可用,但您仍然可以使用谷歌文档查看器。将此URL粘贴到新选项卡中:
https://docs.google.com/viewer?url=
然后粘贴要在线查看的文档的地址。下面是一个例子:
https://docs.google.com/viewer?url=http://research.google.com/archive/bigtable-osdi06.pdf
我认为除了Chrome之外,任何浏览器都不支持在没有插件或第三方工具的情况下渲染PDF。让用户使用自己的应用程序打开PDF可能更容易。
I used the IText PDF library mentioned in this thread Android : Is there any free PDF library for Android for a sample project. You could try getting using this API to get the PDF page as an image. I am not familiar with every aspect of Itext so it might have better way to do this.
I m relatively new to Android development. I m developing an app with a ListView. I ve followed the info in #1338475 and have my app recognizing the fling gesture, but after the gesture is complete, ...
I m converting my code from using Handler to AsyncTask. The latter is great at what it does - asynchronous updates and handling of results in the main UI thread. What s unclear to me is how to handle ...
I want to be able to download a file with a particular extension from the net, and have it passed to my application to deal with it, but I haven t been able to figure out the intent filter. The ...
I am quite impressed by the workflow I follow when developing Android applications: Define a layout in an xml file and then write all the code in a code-behind style. Is there an equivalent style for ...
To draw landscapes, backgrounds with patterns etc, we used TiledLayer in J2ME. Is there an android counterpart for that. Does android provide an option to set such tiled patterns in the layout XML?
When following the Android Open Source Project instructions on installing repo for use with Git, after running the repo init command, I run into this error: /c/Users/Andrew Rabon/bin/repo: line ...
I read in the Android documentation that by setting my Activity s launchMode property to singleTop OR by adding the FLAG_ACTIVITY_SINGLE_TOP flag to my Intent, that calling startActivity(intent) would ...
I have pretty good skills in PHP , Mysql and Javascript for a junior developer. If I wanted to try my hand as Android Development do you think I might find it tough ? Also what new languages would I ...