Merge pull request #12310 from Snuffleupagus/issue-12308
Add support for /Print and /SaveAs named actions in the viewer (issue 12308)
This commit is contained in:
commit
ed9ea8f9b2
17
web/app.js
17
web/app.js
@ -2210,10 +2210,9 @@ function webViewerPageMode({ mode }) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function webViewerNamedAction(evt) {
|
function webViewerNamedAction(evt) {
|
||||||
// Processing couple of named actions that might be useful.
|
// Processing a couple of named actions that might be useful, see also
|
||||||
// See also PDFLinkService.executeNamedAction
|
// `PDFLinkService.executeNamedAction`.
|
||||||
const action = evt.action;
|
switch (evt.action) {
|
||||||
switch (action) {
|
|
||||||
case "GoToPage":
|
case "GoToPage":
|
||||||
PDFViewerApplication.appConfig.toolbar.pageNumber.select();
|
PDFViewerApplication.appConfig.toolbar.pageNumber.select();
|
||||||
break;
|
break;
|
||||||
@ -2223,6 +2222,16 @@ function webViewerNamedAction(evt) {
|
|||||||
PDFViewerApplication.findBar.toggle();
|
PDFViewerApplication.findBar.toggle();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "Print":
|
||||||
|
if (PDFViewerApplication.supportsPrinting) {
|
||||||
|
webViewerPrint();
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "SaveAs":
|
||||||
|
webViewerSave();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user