簡體   English   中英

下載 pdf 並在帶有下載通知的谷歌文檔中打開它

[英]download pdf and open it in google doc with download notification

我想制作一個按鈕,每當用戶按下該按鈕時,都會下載 PDF 並且 pdf 在谷歌文檔或任何其他 pdf 閱讀器中打開。

並且 pdf 將從 url 提供。

我正在使用 java 編程語言。 幫我做這件事。

hii Buddy,我們有很多方法可以在 Google Docs 中打開 pdf 文件

android 意向

   String pdfurl = "http://www.example.com/abcd.pdf";
   String googleDocsUrl = "http://docs.google.com/viewer?url="+pdfurl;
   Intent intent = new Intent(Intent.ACTION_VIEW);
   intent.setDataAndType(Uri.parse(googleDocsUrl ), "text/html");
   startActivity(intent);

web視圖

WebView webview = new WebView(this); 
setContentView(webview); 
webview.getSettings().setJavaScriptEnabled(true); 
webview.loadUrl("example.com/abc.pdf");

了解如何打開 PDF 文件

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM