Change to make work PDF reader using a cusomer app folder

Move the loading of the 'pdf.worker.js' file from ready.js to pdfreader.php
This commit is contained in:
sysadminstory 2022-01-27 23:56:57 +01:00
parent 35450546d9
commit c777a4b518
2 changed files with 3 additions and 1 deletions

View File

@ -145,7 +145,8 @@ document.onreadystatechange = function () {
function renderPdf(file, options) {
PDFJS.filePath = "vendor/pdfjs/";
PDFJS.imageResourcesPath = "vendor/pdfjs/css/images/";
PDFJS.workerSrc = options.session.basePath + 'vendor/pdfjs/lib/pdf.worker.js';
// This file is loaded using the HTML template instead
// PDFJS.workerSrc = options.session.basePath + 'vendor/pdfjs/lib/pdf.worker.js';
var reader = pdfReader(file, options);
}

View File

@ -43,6 +43,7 @@
<link rel="stylesheet" href="<?php p($urlGenerator->linkTo('epubreader', 'vendor/pdfjs/css/text_layer_builder.css')) ?>?v=<?php p($version) ?>">
<link rel="stylesheet" href="<?php p($urlGenerator->linkTo('epubreader', 'vendor/pdfjs/css/annotation_layer_builder.css')) ?>?v=<?php p($version) ?>">
<script type="text/javascript" nonce="<?php p($nonce) ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'vendor/epubjs/libs/jquery.min.js')) ?>?v=<?php p($version) ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce) ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'vendor/pdfjs/lib/pdf.worker.js')) ?>?v=<?php p($version) ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce) ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'vendor/bartaz/jquery.highlight.js')) ?>?v=<?php p($version) ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce) ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'vendor/jquery/put-delete.js')) ?>?v=<?php p($version) ?>"> </script>
<script type="text/javascript" nonce="<?php p($nonce) ?>" src="<?php p($urlGenerator->linkTo('epubreader', 'vendor/sindresorhus/screenfull.js')) ?>?v=<?php p($version) ?>"> </script>