mirror of
https://github.com/alam00000/bentopdf.git
synced 2026-11-09 17:14:16 +01:00
fix: load the pdf.js worker with the Map upsert polyfill
This commit is contained in:
1 parent
8e606b652c
commit
c449a85745
42 files changed
+112
-181
No files matched your search
@@ -1,11 +1,7 @@
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
import type { PDFDocumentProxy } from 'pdfjs-dist';
|
||||
import { PreviewState } from '@/types';
|
||||
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
|
||||
'pdfjs-dist/build/pdf.worker.min.mjs',
|
||||
import.meta.url
|
||||
).toString();
|
||||
import './setup-pdf-worker.js';
|
||||
|
||||
const state: PreviewState = {
|
||||
modal: null,
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = new URL(
|
||||
'pdfjs-dist/build/pdf.worker.min.mjs',
|
||||
import.meta.url
|
||||
).toString();
|
||||
import './setup-pdf-worker.js';
|
||||
|
||||
/**
|
||||
* Configuration for progressive rendering
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import * as pdfjsLib from 'pdfjs-dist';
|
||||
import pdfWorkerUrl from '../pdf.worker?worker&url';
|
||||
|
||||
pdfjsLib.GlobalWorkerOptions.workerSrc = pdfWorkerUrl;
|
||||
Reference in new issue
Block a user