Pdf file downloaded from firebase not showing up.
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();
}
});
}
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 ;)
Closing due to no response from author
@SekthDroid Thanks I tried with pdfView.fromFile(). It works now!