Skip to content

Commit 4711ba5

Browse files
committed
Version 2.4.9
## Version 2.4.9 - October 18, 2025 - **Improved:** Updated PDF.js library to 5.4.296 for stability and performance. - **Added:** Ability to add, edit, view comments in the document. New permission `options.permissions.editComments` with default value of `true`. - **Improved:** Ensure toolbar menus are clamped to the viewer window and repositioned when viewer window is scrolled, resized or menu is resized. - **Improved:** Ensure top toolbar menus are always over vertical toolbar menus. - **Fixed:** When creating multiple instances of viewer in the same page `webviewerloaded` event was being registered multiple times thus causing errors. The viewer id was being unnecessarily incremented even if it did not exist in the document. Track viewer id internally as user may re-assign the window global variable.
1 parent 0aa970b commit 4711ba5

File tree

133 files changed

+5977
-5316
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+5977
-5316
lines changed

APIDocs.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ 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.permissions.editComments` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to edit comments of the document. This is disabled by default as it's not stable yet. (optional, default `false`)
256+
* `options.permissions.editComments` **[Boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** Ability to edit comments of the document. (optional, default `true`)
257257
* `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,
258258
i.e. the specified term will be searched and the term(s) will be highlighted in the pages.
259259
For example, if you launch the viewer from a search results page, you can pass the same search term to the viewer.
@@ -432,7 +432,9 @@ Renders the component in the page.
432432
#### Parameters
433433

434434
* `target` **[Element](https://developer.mozilla.org/docs/Web/API/Element)?** The target DOM element, e.g. the container or adjacent element.
435-
If omitted HTML string will be returned.
435+
If omitted, a HTML string will be returned.
436+
Note that it's expected that user later adds this HTML string to the same window as the caller,
437+
not to other frames, otherwise we cannot track iframe loading events, and component would not work.
436438
* `position` **[String](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** A string representing the position relative to the targetElement* 'beforebegin': Before the targetElement itself.
437439
* 'afterbegin': Just inside the targetElement, before its first child.
438440
* 'beforeend': Just inside the targetElement, after its last child.

dist/docs/index.html

Lines changed: 7 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.8 | Documentation</title>
5+
<title>pdfjskit 2.4.9 | 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.8</code></div>
19+
<div class='mb1'><code>2.4.9</code></div>
2020
<input
2121
placeholder='Filter'
2222
id='filter-input'
@@ -1299,9 +1299,9 @@ <h3 class='fl m0' id='pdfviewer'>
12991299
<tr>
13001300
<td class='break-word'><span class='code bold'>options.permissions.editComments</span> <code class='quiet'><a href="https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean">Boolean</a></code>
13011301

1302-
(default <code>false</code>)
1302+
(default <code>true</code>)
13031303
</td>
1304-
<td class='break-word'><span>Ability to edit comments of the document. This is disabled by default as it's not stable yet.
1304+
<td class='break-word'><span>Ability to edit comments of the document.
13051305
</span></td>
13061306
</tr>
13071307

@@ -2455,7 +2455,9 @@ <h3 class='fl m0' id='pdfviewer'>
24552455
<div>
24562456
<span class='code bold'>target</span> <code class='quiet'>(<a href="https://developer.mozilla.org/docs/Web/API/Element">Element</a>?)</code>
24572457
The target DOM element, e.g. the container or adjacent element.
2458-
If omitted HTML string will be returned.
2458+
If omitted, a HTML string will be returned.
2459+
Note that it's expected that user later adds this HTML string to the same window as the caller,
2460+
not to other frames, otherwise we cannot track iframe loading events, and component would not work.
24592461

24602462
</div>
24612463

0 commit comments

Comments
 (0)