开发者

Google Docs Link and Viewing PDF

开发者 https://www.devze.com 2023-03-18 08:08 出处:网络
https://spreadsheets.google.com/spreadsheet/pub?key=0Ap6NKDUcJz8sdHZjOWM1bkFxZ0wxUW9Bcnl3QmRsbGc&single=true&gid=0&output=pdf

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

The link above downloads the PDF, but I jus开发者_如何学Pythont want it to open up in the browser. Is there a way to do this?


Remove the output=pdf.

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


If you want to open pdf in browser without downloading pdf then below is the best way to do it :

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);


If you want it to open in your browser, you need a PDF viewing plugin for your browser. The same obviously holds true for your visitors as well. It is the browser which determines what to do with files. (open or dowload)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号