DImuthuUpe / AndroidPdfViewer

Android view for displaying PDFs rendered with PdfiumAndroid
Apache License 2.0
8.05k stars 1.85k forks source link

PDF is encrypted or not ? #1097

Open naveedninesol opened 1 year ago

naveedninesol commented 1 year ago

How to check whether our pdf is encrypted or not. Stuck in it

AhmerAfzal1 commented 1 year ago
.onError(object : OnErrorListener {
   override fun onError(t: Throwable?) {
      if (t is PdfPasswordException) {
         //Here do what you want your encrypted pdf
    } else {
         Log.e("Log", "onError: ${t?.message}", t)
    }
   }
})
naveedninesol commented 1 year ago

Thanks I got it

On Tue, Jul 26, 2022 at 12:23 PM Ahmer Afzal @.***> wrote:

.onError(object : OnErrorListener { override fun onError(t: Throwable?) { if (t is PdfPasswordException) { //Here do what you want your encrypted pdf } else { Log.e("Log", "onError: ${t?.message}", t) } } })

— Reply to this email directly, view it on GitHub https://github.com/barteksc/AndroidPdfViewer/issues/1097#issuecomment-1195105717, or unsubscribe https://github.com/notifications/unsubscribe-auth/AZ56DFZTOZXZY5VYEKEK2ADVV6G6PANCNFSM54URHYZQ . You are receiving this because you authored the thread.Message ID: @.***>