AndroidPdfViewer icon indicating copy to clipboard operation
AndroidPdfViewer copied to clipboard

Pdf file downloaded from firebase not showing up.

Open Maddy14 opened this issue 9 years ago • 3 comments

I am trying to download a url from firebase to external storage and then show that file to pdfview, but nothing shows up inside pfview after successfully uploading to firebase and downloading file to external storage.

filepath.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
                @Override
                public void onSuccess(Uri uri) {

                    File file = new File(Environment.getExternalStorageDirectory()
                            .getAbsolutePath()
                            + uri);


                    pdfView.fromFile(file).load();

                }
            }).addOnFailureListener(new OnFailureListener() {
                @Override
                public void onFailure(@NonNull Exception e) {
                    Toast.makeText(Semester_1_syll1.this,"No file exists",Toast.LENGTH_LONG).show();
                }
            });
        }

Maddy14 avatar Aug 26 '17 04:08 Maddy14

If i'm not wrong, based on the Firebase doc this method will get a download url, but it wont download the file.

In the README you can see that this library wont open pdfs from URL.

In the Firebase doc I attached before it tells you how to download the file. Then, with that downloaded file, I think you can be able to open the file with pdfView.fromFile().

Hope it helps ;)

SekthDroid avatar Sep 07 '17 19:09 SekthDroid

Closing due to no response from author

barteksc avatar Nov 12 '17 00:11 barteksc

@SekthDroid Thanks I tried with pdfView.fromFile(). It works now!

Maddy14 avatar Dec 07 '17 04:12 Maddy14