0

I am using this PDF Library in my application at the latest version.

I have a PDFView object declared in this way:

PDFView pdfView = (PDFView) findViewById(R.id.pdfView);

And I would like to check whether if it is currently displaying/containing a PDF.

I did this:

if(pdfView.getPageCount() == 0){
   ...
}

which works, but I'd like something like this line in the library's source code. Sadly we cannot access pdfFile from outside, nor is given to us something like isEmpty() or isNull().

Is there a way to see if the inner pdf is null or not? Thank you.

AlessandroF
  • 542
  • 5
  • 16

1 Answers1

1

This's my suggestion

I don't know if library have a method you want, but when you open pdfFile, you can check it or do another things in onError , it look like this:

    pdfView.fromUri(fileUri)...
           .onError{
               //you can finish or send a message here
           }
ninhnau19
  • 695
  • 1
  • 3
  • 16