We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ba5a02b commit e057968Copy full SHA for e057968
src/utils/asyncReader.js
@@ -1,5 +1,6 @@
1
-import * as pdfjsLib from 'pdfjs-dist'
2
-pdfjsLib.GlobalWorkerOptions.workerSrc = require('pdfjs-dist/build/pdf.worker')
+import { getDocument, GlobalWorkerOptions } from 'pdfjs-dist'
+import * as pdfjsWorker from 'pdfjs-dist/build/pdf.worker'
3
+GlobalWorkerOptions.workerSrc = pdfjsWorker
4
5
/**
6
*
@@ -51,5 +52,5 @@ export function readAsDataURL(file) {
51
52
* @param file
53
*/
54
export async function readAsPDF(file) {
- return pdfjsLib.getDocument(file).promise
55
+ return getDocument(file).promise
56
}
0 commit comments