fix: 移除pdf.js中打开文件、打印、下载按钮

This commit is contained in:
zyd
2022-09-21 00:40:35 +08:00
parent b015299253
commit f8e77e9e9d
2 changed files with 25 additions and 4 deletions
+12 -3
View File
@@ -3145,9 +3145,9 @@ const PDFViewerApplication = {
eventBus._on("switchannotationeditorparams", webViewerSwitchAnnotationEditorParams);
eventBus._on("print", webViewerPrint);
// eventBus._on("print", webViewerPrint);
eventBus._on("download", webViewerDownload);
// eventBus._on("download", webViewerDownload);
eventBus._on("firstpage", webViewerFirstPage);
@@ -3199,7 +3199,7 @@ const PDFViewerApplication = {
eventBus._on("fileinputchange", webViewerFileInputChange);
eventBus._on("openfile", webViewerOpenFile);
// eventBus._on("openfile", webViewerOpenFile);
},
bindWindowEvents() {
@@ -3494,6 +3494,15 @@ function webViewerInitialized() {
appConfig,
eventBus
} = PDFViewerApplication;
appConfig.toolbar.openFile.hidden = true;
appConfig.secondaryToolbar.openFileButton.hidden = true;
appConfig.toolbar.print.hidden = true;
appConfig.secondaryToolbar.printButton.hidden = true;
appConfig.toolbar.download.hidden = true;
appConfig.secondaryToolbar.downloadButton.hidden = true;
appConfig.toolbar.viewBookmark.hidden = true;
appConfig.secondaryToolbar.viewBookmarkButton.hidden = true;
let file;
const queryString = document.location.search.substring(1);
const params = (0, _ui_utils.parseQueryString)(queryString);