Skip to content

Commit

Permalink
[Refactor] Fix workerSrc deprecation notice in examples
Browse files Browse the repository at this point in the history
Signed-off-by: Matthew Peveler <[email protected]>
  • Loading branch information
MasterOdin committed Jun 10, 2021
1 parent b6fda31 commit d57df0d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const RENDER_OPTIONS = {
rotate: 0
};

pdfjsLib.workerSrc = 'pdf.worker.js';
pdfjsLib.GlobalWorkerOptions.workerSrc = 'pdf.worker.js';
PDFJSAnnotate.setStoreAdapter(PDFJSAnnotate.LocalStoreAdapter);

pdfjsLib.getDocument(RENDER_OPTIONS.documentId).promise.then((pdf) => {
Expand Down
2 changes: 1 addition & 1 deletion sandbox/basic/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import annotations from './annotations';

const DOCUMENT_ID = 'PDFJSAnnotate.pdf';

pdfjsViewer.workerSrc = '../shared/pdf.worker.js';
pdfjsViewer.GlobalWorkerOptions.workerSrc = '../shared/pdf.worker.js';

PDFJSAnnotate.StoreAdapter.getAnnotations = (documentId, pageNumber) => {
return new Promise((resolve, reject) => {
Expand Down
2 changes: 1 addition & 1 deletion web/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ let RENDER_OPTIONS = {
};

PDFJSAnnotate.setStoreAdapter(new PDFJSAnnotate.LocalStoreAdapter());
pdfjsLib.workerSrc = './shared/pdf.worker.js';
pdfjsLib.GlobalWorkerOptions.workerSrc = './shared/pdf.worker.js';

// Render stuff
let NUM_PAGES = 0;
Expand Down

0 comments on commit d57df0d

Please sign in to comment.