0
votes

I am trying to open PDF using "https://docs.google.com/gview?embedded=true&url=MyurlLink"

but getting the following error

Sorry,it took too long to find the document at the original source.Please try again later.You can also try to download the original document by clicking here

PDF size is 1.36 MB

Thanks in advance

1
From where you are accessing this url?? - Siddharth_Vyas
I am not getting your question?there is one pdf in the URL which I want to show in my Webview - androidDev
Hi, just want to know if you found a solution for this problem.. I faced the same problem.. but the strange issue is that I tested opening the same file from two servers.. I could open the file on one of them but could not open on the another one! i.e. it seems that it is not related to the server! is there any configuration we should do on the server? - user1149501
Hi ,the problem that I was facing was actually from the server, there was some problem with the URL ...Google docs was not able to connect to the URL link in the given time. - androidDev

1 Answers

1
votes

You can try this :

    @Override
    public boolean shouldOverrideUrlLoading(WebView view, String url) {

        if (url.contains(".pdf")) {
            view.loadUrl("http://docs.google.com/gview?embedded=true&url=http://yoururl.com/yourpdf.pdf");
        } 

        return true;
    }

Hope this helps.