File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11// SPDX-FileCopyrightText: 2026 LibreCode coop and contributors
22// SPDX-License-Identifier: AGPL-3.0-or-later
33
4+ import { GlobalWorkerOptions } from 'pdfjs-dist'
5+ import pdfWorkerCode from 'pdfjs-dist/build/pdf.worker.min.mjs'
6+
7+ GlobalWorkerOptions . workerSrc = pdfWorkerCode
8+
49import PDFElements from './components/PDFElements.vue'
10+ export { setWorkerPath } from './utils/asyncReader.js'
511
612PDFElements . install = function ( Vue ) {
713 if ( PDFElements . install . installed ) return
Original file line number Diff line number Diff line change @@ -6,6 +6,10 @@ import pdfWorkerCode from 'pdfjs-dist/build/pdf.worker.min.mjs'
66
77GlobalWorkerOptions . workerSrc = pdfWorkerCode
88
9+ export function setWorkerPath ( path ) {
10+ GlobalWorkerOptions . workerSrc = path
11+ }
12+
913export function readAsArrayBuffer ( file ) {
1014 return new Promise ( ( resolve , reject ) => {
1115 const reader = new FileReader ( )
You can’t perform that action at this time.
0 commit comments