Skip to content

Commit

Permalink
Merge pull request #140 from nextcloud/fix-load-of-character-maps
Browse files Browse the repository at this point in the history
Fix load of character maps
  • Loading branch information
ChristophWurst authored Jun 27, 2019
2 parents 346af09 + a7a8d83 commit 0925b6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions js/workersrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ function initializeCustomPDFViewerApplication() {
PDFJS.openExternalLinksInNewWindow = true;
PDFJS.isEvalSupported = false;
PDFJS.workerSrc = document.getElementsByTagName('head')[0].getAttribute('data-workersrc');
PDFJS.cMapUrl = document.getElementsByTagName('head')[0].getAttribute('data-cmapurl');

// The download has to be forced to use the URL of the file; by default
// "PDFViewerApplication.download" uses a blob, but this causes a CSP error
Expand Down
3 changes: 2 additions & 1 deletion templates/viewer.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
See https://github.com/adobe-type-tools/cmap-resources
-->
<html dir="ltr" mozdisallowselectionprint moznomarginboxes>
<head data-workersrc="<?php p($urlGenerator->linkTo('files_pdfviewer', 'vendor/pdfjs/build/pdf.worker.js')) ?>?v=<?php p($version) ?>">
<head data-workersrc="<?php p($urlGenerator->linkTo('files_pdfviewer', 'vendor/pdfjs/build/pdf.worker.js')) ?>?v=<?php p($version) ?>"
data-cmapurl="<?php p($urlGenerator->linkTo('files_pdfviewer', 'vendor/pdfjs/web/cmaps/')) ?>">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="google" content="notranslate">
Expand Down

0 comments on commit 0925b6f

Please sign in to comment.