@shahajimbhosle/local-doc-viewer 1.0.2 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -3
- package/dist/index.js +2483 -2485
- package/dist/index.umd.cjs +158 -112
- package/dist/pdf.worker.min-THWjjfik.js +23109 -0
- package/dist/renderers/PdfRenderer.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -83,18 +83,21 @@ For highly sensitive deployments, pair this with a strict Content Security Polic
|
|
|
83
83
|
|
|
84
84
|
### PDF Worker
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
PDF rendering works locally without a CDN or third-party worker URL. By default, the viewer registers PDF.js' packaged worker module before opening a PDF, which avoids Vite resolving the worker from `/node_modules/.vite/deps`.
|
|
87
|
+
|
|
88
|
+
The worker is also published as a separate package asset for advanced setups:
|
|
87
89
|
|
|
88
90
|
```text
|
|
89
91
|
@shahajimbhosle/local-doc-viewer/pdf.worker.min.mjs
|
|
90
92
|
```
|
|
91
93
|
|
|
92
|
-
|
|
94
|
+
If your application wants to provide its own worker URL, configure it once before rendering PDFs:
|
|
93
95
|
|
|
94
96
|
```tsx
|
|
95
97
|
import { configurePdfWorker } from '@shahajimbhosle/local-doc-viewer';
|
|
98
|
+
import pdfWorkerUrl from '@shahajimbhosle/local-doc-viewer/pdf.worker.min.mjs?url';
|
|
96
99
|
|
|
97
|
-
configurePdfWorker(
|
|
100
|
+
configurePdfWorker(pdfWorkerUrl);
|
|
98
101
|
```
|
|
99
102
|
|
|
100
103
|
The worker is intentionally not embedded as an inline base64 JavaScript data URL in the library bundle, because large inline executable payloads can trigger package malware scanners even when the code comes from PDF.js.
|