Fix for #1223 (pdf-reader isn't working on chrome, IE, Edge)

pull/1258/head
Ozzieisaacs 5 years ago
parent df7d3d18b6
commit fb83bfb363

@ -4372,7 +4372,7 @@ var defaultOptions = {
kind: OptionKind.WORKER kind: OptionKind.WORKER
}, },
workerSrc: { workerSrc: {
value: '../../../static/js/libs/pdf.worker.js', value: '../build/pdf.worker.js',
kind: OptionKind.WORKER kind: OptionKind.WORKER
} }
}; };

@ -35,18 +35,18 @@ See https://github.com/adobe-type-tools/cmap-resources
<!-- This snippet is used in production (included from viewer.html) --> <!-- This snippet is used in production (included from viewer.html) -->
<link rel="resource" type="application/l10n" href="{{ url_for('static', filename='locale/locale.properties') }}"> <link rel="resource" type="application/l10n" href="{{ url_for('static', filename='locale/locale.properties') }}">
<script src="{{ url_for('static', filename='js/libs/pdf.js') }}"></script>
<script type="text/javascript"> <script type="text/javascript">
window.addEventListener('load', function() { window.addEventListener('webviewerloaded', function() {
PDFViewerApplicationOptions.set('sidebarViewOnLoad', 0); PDFViewerApplicationOptions.set('sidebarViewOnLoad', 0);
PDFViewerApplicationOptions.set('imageResourcesPath', "{{ url_for('static', filename='css/images/') }}"); PDFViewerApplicationOptions.set('imageResourcesPath', "{{ url_for('static', filename='css/images/') }}");
PDFViewerApplicationOptions.set('workerSrc', "{{ url_for('static', filename='js/libs/pdf.worker.js') }}"); PDFViewerApplicationOptions.set('workerSrc', "{{ url_for('static', filename='js/libs/pdf.worker.js') }}");
PDFViewerApplicationOptions.set('defaultUrl',"{{ url_for('web.serve_book', book_id=pdffile, book_format='pdf') }}") PDFViewerApplicationOptions.set('defaultUrl',"{{ url_for('web.serve_book', book_id=pdffile, book_format='pdf') }}")
}); });
</script> </script>
<script src="{{ url_for('static', filename='js/libs/pdf.js') }}"></script>
<script src="{{ url_for('static', filename='js/libs/viewer.js') }}"></script>
<script src="{{ url_for('static', filename='js/libs/viewer.js') }}"></script>
</head> </head>

Loading…
Cancel
Save