Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions js/files_pdfviewer-workersrc.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion js/files_pdfviewer-workersrc.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/workersrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
const urlParams = new URLSearchParams(queryString)
const hideDownload = urlParams.get('hideDownload')

function initializeCustomPDFViewerApplication() {

Check warning on line 36 in src/workersrc.js

View workflow job for this annotation

GitHub Actions / NPM lint

Missing JSDoc comment
const head = document.getElementsByTagName('head')[0]

// Preferences override options, so they must be disabled for
Expand All @@ -46,7 +46,7 @@
PDFViewerApplicationOptions.set('cMapUrl', head.getAttribute('data-cmapurl'))
PDFViewerApplicationOptions.set('sandboxBundleSrc', head.getAttribute('data-sandbox'))
PDFViewerApplicationOptions.set('enablePermissions', true)
PDFViewerApplicationOptions.set('imageResourcesPath', './js/pdfjs/web/images/')
PDFViewerApplicationOptions.set('imageResourcesPath', head.getAttribute('data-imageresourcespath'))
PDFViewerApplicationOptions.set('enableScripting', head.getAttribute('data-enableScripting') === true)

if (hideDownload === '1') {
Expand Down
3 changes: 2 additions & 1 deletion templates/viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@
<head data-workersrc="<?php p($urlGenerator->linkTo('files_pdfviewer', 'js/pdfjs/build/pdf.worker.js')) ?>?v=<?php p($version) ?>"
data-enableScripting="<?php p($enableScripting ? true : false) ?>"
data-sandbox="<?php p($urlGenerator->linkTo('files_pdfviewer', 'js/pdfjs/build/pdf.sandbox.js'))?>"
data-cmapurl="<?php p($urlGenerator->linkTo('files_pdfviewer', 'js/pdfjs/web/cmaps/')) ?>">
data-cmapurl="<?php p($urlGenerator->linkTo('files_pdfviewer', 'js/pdfjs/web/cmaps/')) ?>"
data-imageresourcespath="<?php p($urlGenerator->linkTo('files_pdfviewer', 'js/pdfjs/web/images/')) ?>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="google" content="notranslate">
Expand Down
Loading