add on (doc) loaded callback

This commit is contained in:
Pratyush 2022-05-06 22:37:20 +05:30 committed by Daniel Micay
parent 3ebdfd0a11
commit 68fc48d3a9
2 changed files with 5 additions and 0 deletions

View File

@ -210,6 +210,7 @@ function loadDocument() {
}
loadingTask.promise.then(function (newDoc) {
channel.onLoaded();
pdfDoc = newDoc;
channel.setNumPages(pdfDoc.numPages);
pdfDoc.getMetadata().then(function (data) {

View File

@ -202,6 +202,10 @@ public class PdfViewer extends AppCompatActivity implements LoaderManager.Loader
showPasswordPrompt();
}
@JavascriptInterface
public void onLoaded() {
}
@JavascriptInterface
public String getPassword() {
return mEncryptedDocumentPassword != null ? mEncryptedDocumentPassword : "";