0

I have a uri for a PDF file (which I am storing on Firebase Storage) and I am trying to display it on the screen to the user. I have found a bunch of people talking about the PDF Renderer found in API 21 and later but the answers I have found seem outdated and don't work. Here is my code so far

//Get image from database
StorageReference pdfRef = storageReference.child(userID + "/reports/" + reportID);
pdfRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
    @Override
    public void onSuccess(Uri uri) {

    }
});

What is the simplest way to take the uri I already have and display the PDF which it leads to?

Federico klez Culloca
  • 26,308
  • 17
  • 56
  • 95

1 Answers1

0

You have two options:

1- If you want to open PDF in your app, you can use this library: https://github.com/viavansi/mupdf-android

2- You can open it in a PDF viewer, see this answer: https://stackoverflow.com/a/10530506/6603416

ahmed galal
  • 504
  • 5
  • 15