Google文档链接和查看PDF

时间:2011-07-07 23:34:47

标签: google-docs

https://spreadsheets.google.com/spreadsheet/pub?key=0Ap6NKDUcJz8sdHZjOWM1bkFxZ0wxUW9Bcnl3QmRsbGc&single=true&gid=0&output=pdf

上面的链接下载PDF,但我只想在浏览器中打开它。有没有办法做到这一点?

3 个答案:

答案 0 :(得分:1)

答案 1 :(得分:0)

如果你想在不下载pdf的情况下在浏览器中打开pdf,那么下面是最好的方法:

Intent i = new Intent(Intent.ACTION_VIEW);
String yoururl = https://spreadsheets.google.com/spreadsheet/pub?key=0Ap6NKDUcJz8sdHZjOWM1bkFxZ0wxUW9Bcnl3QmRsbGc&single=true&gid=0&output=pdf;
yoururl= "https://drive.google.com/viewerng/viewer?embedded=true&url=" + yoururl;
i.setData(Uri.parse(yoururl));
startActivity(i);

答案 2 :(得分:-1)

如果您希望在浏览器中打开它,则需要为您的浏览器提供PDF查看插件。 同样显然也适用于您的访问者。 它是确定如何处理文件的浏览器。 (开放或下载)

相关问题