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.
- package/README.md +11 -0
- 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
|