1
0
Fork 0
mirror of https://github.com/mozilla/pdf.js.git synced 2025-04-20 15:18:08 +02:00

JS - Implement few possibilities with app.execMenuItem (bug 1724399)

- it aims to fix: https://bugzilla.mozilla.org/show_bug.cgi?id=1724399.
This commit is contained in:
Calixte Denizet 2021-09-17 19:35:00 +02:00
parent 7082ff9bf8
commit bfd570038d
2 changed files with 45 additions and 2 deletions

View file

@ -305,6 +305,33 @@ class PDFScriptingManager {
}
this._pdfViewer.currentScaleValue = value;
break;
case "SaveAs":
this._eventBus.dispatch("save", { source: this });
break;
case "FirstPage":
this._pdfViewer.currentPageNumber = 1;
break;
case "LastPage":
this._pdfViewer.currentPageNumber = this._pdfViewer.pagesCount;
break;
case "NextPage":
this._pdfViewer.nextPage();
break;
case "PrevPage":
this._pdfViewer.previousPage();
break;
case "ZoomViewIn":
if (isInPresentationMode) {
return;
}
this._eventBus.dispatch("zoomin", { source: this });
break;
case "ZoomViewOut":
if (isInPresentationMode) {
return;
}
this._eventBus.dispatch("zoomout", { source: this });
break;
}
return;
}