()
| 22 | let _pdfjsUrl: string | null = null |
| 23 | |
| 24 | function getPdfjsUrl(): string | null { |
| 25 | if (_pdfjsUrl !== null) return _pdfjsUrl |
| 26 | try { |
| 27 | // Resolve via the bundler/dev server so the URL is usable from a Worker |
| 28 | _pdfjsUrl = new URL('pdfjs-dist/build/pdf.min.mjs', import.meta.url).toString() |
| 29 | } catch { |
| 30 | _pdfjsUrl = '' |
| 31 | } |
| 32 | return _pdfjsUrl || null |
| 33 | } |
| 34 | |
| 35 | // --------------------------------------------------------------------------- |
| 36 | // Worker-based renderer (fully isolated from main thread pdfjs) |
no test coverage detected