Skip to content

Commit 30c3683

Browse files
committed
Version 2.4.3
## Version 2.4.3 - August 27, 2025 - **Improved:** When using `searchOptions.matchAnyWord`, now the quotation marks can be used to specify phrases inside a query that is set via `searchOptions.term`. For example; - `red "four wheels" petrol` will match `red` or `four wheels` or `petrol` or `red four wheels petrol` - `red ""four wheels"" petrol` will match `red` or `"four wheels"` or `petrol` or `red "four wheels" petrol` Note that two consecutive quotation marks `""` can be used to escape, i.e. to search for a quotation mark literally as `"`. The same feature can also be used in the Viewer's Find dialog.
1 parent d89f269 commit 30c3683

7 files changed

Lines changed: 26 additions & 15 deletions

File tree

APIDocs.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -253,18 +253,20 @@ Renders PDF.js viewer in an iframe but updates UI theme and structure for a neat
253253
* `options.permissions.viewAnnotations` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to view annotations of the document. Note that this can also effect displaying of the signatures in the document so be aware when you disable it. (optional, default `true`)
254254
* `options.permissions.editAnnotations` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to edit annotations of the document. Tools like Add Signature, Highlight, Draw, Add Image will be available. If no ViewAnnotations permission, then you can add new annotations but not view and edit existing ones. (optional, default `true`)
255255
* `options.permissions.fillForms` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to fill values into form fields of the document. Requires also ViewAnnotations permission. (optional, default `true`)
256-
* `options.searchOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The text search options of the viewer.
257-
If you specify a search term, an automatic search will be done when the document is displayed,
256+
* `options.searchOptions` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** The text search options of the viewer.If you specify a search term, an automatic search will be done when the document is displayed,
258257
i.e. the specified term will be searched and the term(s) will be highlighted in the pages.
259258
For example, if you launch the viewer from a search results page, you can pass the same search term to the viewer.
260259

261-
* `options.searchOptions.term` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A value that specifies the search term used. (optional, default `""`)
260+
* `options.searchOptions.term` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A value that specifies the search term used.Refer to `options.searchOptions.matchAnyWord` to see how to specify multiple phrases inside a query. (optional, default `""`)
262261
* `options.searchOptions.matchCase` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** The search should be case-sensitive, i.e. the found text must match the case of the search term. (optional, default `false`)
263262
* `options.searchOptions.matchDiacritics` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** The search should match the letters with diacritics (accents), e.g `u` matches also `ü`.
264263
Diacritics, often loosely called `accents`, are the various little dots and squiggles which, in many languages,
265264
are written above, below or on top of certain letters of the alphabet to indicate something about their pronunciation. (optional, default `false`)
266265
* `options.searchOptions.matchWholeWord` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** The search should match the whole word only, i.e the found text must be a whole word (surrounded by a non-word character). (e.g. "doc" matches " doc " or ".doc" but not "document"). (optional, default `false`)
267-
* `options.searchOptions.matchAnyWord` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** The search should match the term as a whole or match any word in the term separately (e.g. "bicycle bells" or "bicycle" or "bells"). (optional, default `false`)
266+
* `options.searchOptions.matchAnyWord` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** The search should match the term as a whole or match any word in the term separately.For example;* `bicycle bells` will match `bicycle` or `bells` or `bicycle bells`
267+
* `red "four wheels" petrol` will match `red` or `four wheels` or `petrol` or `red four wheels petrol`
268+
* `red ""four wheels"" petrol` will match `red` or `"four wheels"` or `petrol` or `red "four wheels" petrol`The quotation marks can be used to specify phrases inside a query.
269+
Note that two consecutive quotation marks `""` can be used to escape, i.e. to search for a quotation mark literally as `"`. (optional, default `false`)
268270
* `options.searchOptions.highlightColor` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The color to use for highlighting search results. Default is yellow. (optional, default `"#FFFF00"`)
269271
* `options.searchOptions.activeHighlightColor` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** The color to use for highlighting active (current) search result. Default is orange. (optional, default `"#FFA500"`)
270272
* `options.searchOptions.highlightAll` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** A value that specifies whether to highlight all search results, i.e. not only active (current) search result. (optional, default `true`)

dist/docs/index.html

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<html lang="en">
33
<head>
44
<meta charset='utf-8'>
5-
<title>pdfjskit 2.4.2 | Documentation</title>
5+
<title>pdfjskit 2.4.3 | Documentation</title>
66
<meta name='description' content='PdfJsKit is a PDF Viewer built on top of PDF.js, with modern UI and new features which supports integration for all JS frameworks.'>
77
<meta name='viewport' content='width=device-width,initial-scale=1'>
88
<link href='assets/bass.css' rel='stylesheet'>
@@ -16,7 +16,7 @@
1616
<div id='split-left' class='overflow-auto fs0 height-viewport-100'>
1717
<div class='py1 px2'>
1818
<h3 class='mb0 no-anchor'>pdfjskit</h3>
19-
<div class='mb1'><code>2.4.2</code></div>
19+
<div class='mb1'><code>2.4.3</code></div>
2020
<input
2121
placeholder='Filter'
2222
id='filter-input'
@@ -1303,9 +1303,9 @@ <h3 class='fl m0' id='pdfviewer'>
13031303
<td class='break-word'><span class='code bold'>options.searchOptions</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object">Object</a>?</code>
13041304
</td>
13051305
<td class='break-word'><span>The text search options of the viewer.
1306-
If you specify a search term, an automatic search will be done when the document is displayed,
1306+
<p>If you specify a search term, an automatic search will be done when the document is displayed,
13071307
i.e. the specified term will be searched and the term(s) will be highlighted in the pages.
1308-
For example, if you launch the viewer from a search results page, you can pass the same search term to the viewer.
1308+
For example, if you launch the viewer from a search results page, you can pass the same search term to the viewer.</p>
13091309
</span></td>
13101310
</tr>
13111311

@@ -1316,6 +1316,7 @@ <h3 class='fl m0' id='pdfviewer'>
13161316
(default <code>&quot;&quot;</code>)
13171317
</td>
13181318
<td class='break-word'><span>A value that specifies the search term used.
1319+
<p>Refer to <code>options.searchOptions.matchAnyWord</code> to see how to specify multiple phrases inside a query.</p>
13191320
</span></td>
13201321
</tr>
13211322

@@ -1367,7 +1368,15 @@ <h3 class='fl m0' id='pdfviewer'>
13671368

13681369
(default <code>false</code>)
13691370
</td>
1370-
<td class='break-word'><span>The search should match the term as a whole or match any word in the term separately (e.g. "bicycle bells" or "bicycle" or "bells").
1371+
<td class='break-word'><span>The search should match the term as a whole or match any word in the term separately.
1372+
<p>For example;</p>
1373+
<ul>
1374+
<li><code>bicycle bells</code> will match <code>bicycle</code> or <code>bells</code> or <code>bicycle bells</code></li>
1375+
<li><code>red "four wheels" petrol</code> will match <code>red</code> or <code>four wheels</code> or <code>petrol</code> or <code>red four wheels petrol</code></li>
1376+
<li><code>red ""four wheels"" petrol</code> will match <code>red</code> or <code>"four wheels"</code> or <code>petrol</code> or <code>red "four wheels" petrol</code></li>
1377+
</ul>
1378+
<p>The quotation marks can be used to specify phrases inside a query.
1379+
Note that two consecutive quotation marks <code>""</code> can be used to escape, i.e. to search for a quotation mark literally as <code>"</code>.</p>
13711380
</span></td>
13721381
</tr>
13731382

dist/pdfjskit/pdfjskit.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/pdfjskit/pdfjskit.min.mjs

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

examples/pdfjskit-vite-example/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,6 @@
1212
"vite": "^5.4.8"
1313
},
1414
"dependencies": {
15-
"pdfjskit": "^2.4.2"
15+
"pdfjskit": "^2.4.3"
1616
}
1717
}

package/package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "pdfjskit",
3-
"version": "2.4.2",
3+
"version": "2.4.3",
44
"description": "PdfJsKit is a PDF Viewer built on top of PDF.js, with modern UI and new features which supports integration for all JS frameworks.",
55
"keywords": [
66
"pdf-viewer",

0 commit comments

Comments
 (0)