Skip to content

Commit d57df0d

Browse files
committed
[Refactor] Fix workerSrc deprecation notice in examples
Signed-off-by: Matthew Peveler <[email protected]>
1 parent b6fda31 commit d57df0d

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ const RENDER_OPTIONS = {
3131
rotate: 0
3232
};
3333

34-
pdfjsLib.workerSrc = 'pdf.worker.js';
34+
pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdf.worker.js';
3535
PDFJSAnnotate.setStoreAdapter(PDFJSAnnotate.LocalStoreAdapter);
3636

3737
pdfjsLib.getDocument(RENDER_OPTIONS.documentId).promise.then((pdf) => {

sandbox/basic/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import annotations from './annotations';
33

44
const DOCUMENT_ID = 'PDFJSAnnotate.pdf';
55

6-
pdfjsViewer.workerSrc = '../shared/pdf.worker.js';
6+
pdfjsViewer.GlobalWorkerOptions.workerSrc = '../shared/pdf.worker.js';
77

88
PDFJSAnnotate.StoreAdapter.getAnnotations = (documentId, pageNumber) => {
99
return new Promise((resolve, reject) => {

web/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ let RENDER_OPTIONS = {
2121
};
2222

2323
PDFJSAnnotate.setStoreAdapter(new PDFJSAnnotate.LocalStoreAdapter());
24-
pdfjsLib.workerSrc = './shared/pdf.worker.js';
24+
pdfjsLib.GlobalWorkerOptions.workerSrc = './shared/pdf.worker.js';
2525

2626
// Render stuff
2727
let NUM_PAGES = 0;

0 commit comments

Comments
 (0)