Vote count:
0
I am using this link to render PDF in Android:
I load the PDF like this:
pdfView.loadUrl("file://" + getFilesDir() + "/index.html?file=" + path);
It works fine.
Then I do this:
pdfView.loadUrl("javascript:onGotoPage(" + currentPage + ")");
I have written my own function in customview.js:
function onGotoPage(pageNo) {
if (pageNo < 1 || pageNo > pdfDoc.numPages) {
return;
}
pageNum = pageNo;
queueRenderPage(pageNum);
}
But it always displays the first page.
If I call this function from an event, like a button press, it works fine.
But when I call this function the first time just after the file has been loaded, it doesn't work and displays the first page.
I think it has something to do in javascript? I have not much experience in java script!
Or can please someone tell me to load the PDF by passing the page number to load in the URL?
asked 53 secs ago
Android Mozilla PDF JS renderer always loads first page at loading
Aucun commentaire:
Enregistrer un commentaire