pdf-search-highlight 0.3.2 → 0.3.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.
Files changed (2) hide show
  1. package/README.md +11 -0
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -26,6 +26,17 @@ npm install pdf-search-highlight pdfjs-dist
26
26
  - Separate UI and PDF rendering — put search bar anywhere
27
27
  - Search highlights preserved across zoom changes
28
28
 
29
+ ## Setup pdfjs-dist
30
+
31
+ This library requires `pdfjs-dist` as a peer dependency. You need to configure the worker before using it:
32
+
33
+ ```js
34
+ import * as pdfjsLib from "pdfjs-dist";
35
+
36
+ // Use the standard build worker (not legacy)
37
+ pdfjsLib.GlobalWorkerOptions.workerSrc = `//cdnjs.cloudflare.com/ajax/libs/pdf.js/${pdfjsLib.version}/pdf.worker.min.js`;
38
+ ```
39
+
29
40
  ## Usage
30
41
 
31
42
  ### Vanilla JS
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pdf-search-highlight",
3
- "version": "0.3.2",
3
+ "version": "0.3.3",
4
4
  "description": "Drop-in PDF viewer with text search and highlight. Vanilla JS core + React wrapper.",
5
5
  "type": "module",
6
6
  "main": "./dist/core/index.cjs",