If this file is encrypted, how do you automatically pop a window to prompt the user to enter a password?
a dialog and callback.
You add your own code to do this, as you said pop up a dialog and then reload the pdf with the password no callback in a sense. Just reload the pdf.
Hi, how do I detect this PDF file with a password?
Simply catch the error then show your dialog box and reload pdfviewer with the new password inputted by the user.
yeah, thanks a lot.
If you were struggling... this will help..
.onError(new OnErrorListener() {
@Override
public void onError(Throwable t) {
if (t instanceof PdfPasswordException) {
//add your code here
}
}
}
thanks, I've done it like you did.
but the pdf file was parsed twice..
Every PDF reader works that way
Thanks @barteksc @1stmetro
Most helpful comment
If you were struggling... this will help..
.onError(new OnErrorListener() {
@Override
public void onError(Throwable t) {
if (t instanceof PdfPasswordException) {
//add your code here
}
}
}