From f8e77e9e9d0b5c09ef87ea5ad63872c9d9a3a14b Mon Sep 17 00:00:00 2001 From: zyd Date: Wed, 21 Sep 2022 00:40:35 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E7=A7=BB=E9=99=A4pdf.js=E4=B8=AD?= =?UTF-8?q?=E6=89=93=E5=BC=80=E6=96=87=E4=BB=B6=E3=80=81=E6=89=93=E5=8D=B0?= =?UTF-8?q?=E3=80=81=E4=B8=8B=E8=BD=BD=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/pdf/web/viewer.html | 14 +++++++++++++- public/static/pdf/web/viewer.js | 15 ++++++++++++--- 2 files changed, 25 insertions(+), 4 deletions(-) diff --git a/public/static/pdf/web/viewer.html b/public/static/pdf/web/viewer.html index 6f8f333f7..4814faf11 100644 --- a/public/static/pdf/web/viewer.html +++ b/public/static/pdf/web/viewer.html @@ -199,7 +199,6 @@ See https://github.com/adobe-type-tools/cmap-resources - @@ -343,6 +342,18 @@ See https://github.com/adobe-type-tools/cmap-resources Presentation Mode + + + + + + Current View @@ -657,6 +668,7 @@ See https://github.com/adobe-type-tools/cmap-resources } } + diff --git a/public/static/pdf/web/viewer.js b/public/static/pdf/web/viewer.js index a453ac1aa..476116b8b 100644 --- a/public/static/pdf/web/viewer.js +++ b/public/static/pdf/web/viewer.js @@ -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);