2016-03-22 4 views
1

Ich benutze MuPDF-Bibliothek, um eine PDF in der Anwendung zu lesen. Für eine normale pdf, es funktioniert gut für mich. Aber für ein passwortgeschütztes PDF konnte ich mein pdf nicht öffnen. Wie man es möglich macht? Kann mir jemand helfen? Ich benutzte Beispielcode:Wie lesen Sie passwortgeschützt/Passwort aus pdf in Android entfernen?

private MuPDFCore openFile(String path) { 
     int lastSlashPos = path.lastIndexOf('/'); 
     mFilePath = lastSlashPos == -1 ? path : path.substring(lastSlashPos + 1); 
     try { 
      core = new MuPDFCore(mContext, path); 
     } catch (Exception e) { 
      Log.e(tag, "Error: "+e.getMessage()); 
      return null; 
     } 
     return core; 
    } 

Antwort

1

Blick auf requestPassword (und die Anrufe es) in MuPDFActivity.java im mupdf Android Beispielcode.