Skip to content

Commit 6faacd0

Browse files
committed
Revert "fix: use non-legacy pdfjs version"
This reverts commit 334f525.
1 parent 334f525 commit 6faacd0

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/js/directives/pdf-viewer.directive.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
* Refactored as a directive by Stacey Beard, Aug 2021 (pdf-viewer.directive.js).
1010
*/
1111
// See: https://github.com/mozilla/pdf.js/tree/master/examples/webpack
12-
import * as pdfjsLib from 'pdfjs-dist/webpack.mjs';
12+
import * as pdfjsLib from '../../lib/pdfjs_legacy_webpack.mjs';
1313

1414
(function () {
1515
'use strict';

src/lib/pdfjs_legacy_webpack.mjs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// SPDX-FileCopyrightText: Copyright (C) 2024 Opal Health Informatics Group at the Research Institute of the McGill University Health Centre <john.kildea@mcgill.ca>
2+
//
3+
// SPDX-License-Identifier: Apache-2.0
4+
5+
import { GlobalWorkerOptions } from "pdfjs-dist/legacy/build/pdf.mjs";
6+
7+
if (typeof window !== "undefined" && "Worker" in window) {
8+
GlobalWorkerOptions.workerPort = new Worker(
9+
new URL("pdfjs-dist/legacy/build/pdf.worker.mjs", import.meta.url),
10+
{ type: "module" }
11+
);
12+
}
13+
14+
export * from "pdfjs-dist/legacy/build/pdf.mjs";

0 commit comments

Comments
 (0)