如何从服务器的android打开PDF文件 [英] How to open a PDF file from server in android

查看:135
本文介绍了如何从服务器的android打开PDF文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,其中有一个 URL =HTTP://www.example/Open.pdf

I have a requirement where there is a URL = "http://www.example/Open.pdf"

现在从我的Andr​​oid应用程序,我想打开这个 PDF 直接在默认 PDF阅读器文件。

Now from my android application I want to open this PDF file directly in the default PDF viewer.

那一刻我点击网​​页此链接,用户应该psented用默认的PDF查看器中打开此文件$ P $。

The moment I click on this link on the webpage, user should be presented with a default PDF viewer opened with this document.

注:该文件不应该被存储在 SD卡上

Note: This file should not be stored on the SD card.

我如何进行此实现?

推荐答案

有没有办法,你可以从你的应用程序中打开一个默认的PDF浏览。

There is no way you can open a default PDF view from your application.

如果你的文件在服务器上,你想打开它,而无需下载那么这也可能造成更大的安全隐患。如果外部应用程序,如默认的Adobe阅读器可以访问内容服务器上,那么这完全打破了安全框架。

If your file is on the server and you want to open it without downloading then this might also pose a greater security concern. If external applications like default adobe reader can access the content on your server, then this is breaking the security framework altogether.

所以,最好的办法是启动浏览器或web视图的新实例,并显示在谷歌文档的PDF文档给用户。

So, best option would be to launch a new instance of browser or webview and show the PDF document in google docs to the user.

这样用户可以读取该文件,并返回到应用程序的最近的状态也是如此。

This way user can read the document and get back to the recent state of the application as well.

这篇关于如何从服务器的android打开PDF文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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