@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 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
- The PDF.js worker is published as a separate package asset at:
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
- The viewer tries to resolve that worker automatically from the package bundle. If your build system serves package assets from a different location, copy `pdf.worker.min.mjs` to your public assets and configure it once before rendering PDFs:
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('/pdf.worker.min.mjs');
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.