Merge pull request #14038 from calixteman/saveas
JS - Implement few possibilities with app.execMenuItem (bug 1724399)
This commit is contained in:
commit
ffa2572bdf
@ -479,8 +479,24 @@ class App extends PDFObject {
|
|||||||
/* Not implemented */
|
/* Not implemented */
|
||||||
}
|
}
|
||||||
|
|
||||||
execMenuItem() {
|
execMenuItem(item) {
|
||||||
/* Not implemented */
|
switch (item) {
|
||||||
|
case "SaveAs":
|
||||||
|
case "FirstPage":
|
||||||
|
case "LastPage":
|
||||||
|
case "NextPage":
|
||||||
|
case "PrevPage":
|
||||||
|
case "ZoomViewIn":
|
||||||
|
case "ZoomViewOut":
|
||||||
|
this._send({ command: item });
|
||||||
|
break;
|
||||||
|
case "FitPage":
|
||||||
|
this._send({ command: "zoom", value: "page-fit" });
|
||||||
|
break;
|
||||||
|
case "Print":
|
||||||
|
this._send({ command: "print" });
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
getNthPlugInName() {
|
getNthPlugInName() {
|
||||||
|
@ -305,6 +305,33 @@ class PDFScriptingManager {
|
|||||||
}
|
}
|
||||||
this._pdfViewer.currentScaleValue = value;
|
this._pdfViewer.currentScaleValue = value;
|
||||||
break;
|
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;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user