From 697c62c2bdf542a34c81f929cc90fd3c8cadc979 Mon Sep 17 00:00:00 2001 From: Vincent Vanwaelscappel Date: Wed, 22 Dec 2021 18:48:30 +0100 Subject: [PATCH] wip #4979 @0.5 --- app/Jobs/ProcessFluidbook.php | 10 +++++++++- resources/pdfjs/web/viewer.css | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/app/Jobs/ProcessFluidbook.php b/app/Jobs/ProcessFluidbook.php index c38e646..89f211b 100644 --- a/app/Jobs/ProcessFluidbook.php +++ b/app/Jobs/ProcessFluidbook.php @@ -69,8 +69,16 @@ class ProcessFluidbook extends Compiler public function prepareStub() { parent::prepareStub(); - Files::rmdir($this->stub.'/pdfjs'); + Files::rmdir($this->stub . '/pdfjs'); $this->vdir->copyDirectory(resource_path('pdfjs'), '/pdfjs'); + $css = file_get_contents(resource_path('pdfjs') . '/web/viewer.css'); + $css = '.article #sidebarContainer, .article .toolbar {display:none !important;}'; + $css .= '.article .pdfViewer{padding:0 !important;}'; + $css .= '.article #viewerContainer{top:0 !important;overflow:visible !important;}'; + $css .= '.article{--page-border:0;--page-margin:0;--body-bg-color:transparent;}'; + $css .= '.openFile,.rotateCw,.rotateCcw,.rotateCcw + .horizontalToolbarSeparator{display:none !important;}'; + $css .= '.bookmark,.print,.download{display:none !important}'; + $this->vdir->file_put_contents('pdfjs/web/viewer.css', $css); } protected function _getAssetCollection($id) diff --git a/resources/pdfjs/web/viewer.css b/resources/pdfjs/web/viewer.css index e35bdda..49e1e11 100644 --- a/resources/pdfjs/web/viewer.css +++ b/resources/pdfjs/web/viewer.css @@ -2663,3 +2663,5 @@ html[dir="rtl"] #documentPropertiesOverlay .row > * { display: none; } } + + -- 2.39.5