@mescius/dspdfviewer
Version:
Document Solutions PDF Viewer
876 lines (827 loc) • 168 kB
Markdown
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## [9.0.0] - 05-Dec-2025
### Added
- Added HighlightManager API, providing programmatic control over text and custom highlights. (DOC-7151)
### Fixed
- Improved thumbnail image quality in the PDF Organizer dialog. (DOC-7019)
- Fixed a "Worker was terminated" console error when switching between PDF files. (DOC-7152)
- Fixed issues with stamp annotations when using certain transparent images. (DOC-7155)
- [Localization] [Regression] The "Show All" button in notifications was not localized when using the Japanese language. (DOC-7146)
## [8.2.2] - 17-Nov-2025
### Added
- Added findField() and findFields() methods to reliably access current field values.
```javascript
// Example:
viewer.validateForm(async (value, field) => {
const currentField = await viewer.findField(field.fieldName);
if (field.fieldName === "fld1") {
console.log(currentField.fieldValue === "Yes" ? "Validation passed." : "Checkbox fld1 must be checked");
}
});
```
### Fixed
- [Regression] [Localization] Fixed missing localization for the "Show All" button in notifications. (DOC-7146)
- Fixed incorrect page thumbnail display in the PDF Organizer dialog. (DOC-7019)
- Fixed a false "Worker was terminated" console error when quickly switching between PDF files. ((DOC-7152))
- [Server] [Editor] Fixed errors that occurred in Chrome when adding certain PNG images as stamps. (DOC-7155)
- Fixed an issue where checkbox state in validateForm reflected the initial value instead of the current value. (DOC-7192)
## [8.2.1] - 10-Oct-2025
### Added
- Added a font embedding mode option to the `registerFont` method.
The new `embedMode` parameter controls how fonts are embedded in PDF output.
Available values: `NotEmbed`, `EmbedSubset`, `EmbedFullFont`, `EmbedSubsetNoForms`. (DOC-7070)
```javascript
// Example:
viewer.registerFont('Lato', '/fonts/Lato.ttf', {
embedMode: 'EmbedSubset'
});
```
- Added documentation for HighlightManager API methods and types.
### Fixed
- Fixed an issue where entering a zoom value in the zoom textbox did not work while the “Zoom Mode” dropdown was open. (DOC-7047)
- [Form Editor] Fixed an issue where the drag handle for changing tab order was not displayed. (DOC-7052)
### Changed
- Updated JPN localization for V8.2J. (DOC-7055)
## [8.2.0] - 08-Aug-2025
### Added
- [Annotation Editor] Enabled selection of overlapping annotations in edit mode via the context menu. (DOC-6957)
- [Wasm] [Editor] Enabled table data extractor tool in client-side (Wasm) SupportApi mode. (DOC-6918)
- [Wasm] [Editor] Enabled text replace functionality in client-side (Wasm) SupportApi mode. (DOC-6522, DOC-6786)
- Added new navigation configuration options. (DOC-6411)
```javascript
navigation: {
showFirstButton: false, // Toggle first page button
showLastButton: false, // Toggle last page button
showPageInput: true, // Toggle page input field
pageCounterFormat: "Page {{current}} of {{total}}", // Custom counter format
emptyPageCounterFormat: '-- No Document --', // Empty state text
pageInputWidth: 100 // Input field width in px
buttonSizing: 'compact' // Controls the sizing of navigation buttons:
// - 'compact': 30px width (default)
// - 'standard': 40px width
// - number: Custom width in pixels
}
```
### Changed
- Partial HTTP requests (Range requests) are now disabled by default via `openParameters.disableRange = true`. (DOC-6969)
- To enable Range requests, configure the viewer as follows:
```javascript
const viewer = new DsPdfViewer('#viewer', {
openParameters: {
disableRange: false
}
});
```
- Improved support for Japanese and other IME-based input in comb fields. (DOC-6533)
- Fixed character input issues when using Japanese, Chinese, or emoji keyboards.
- IME-composed text is now correctly distributed across comb cells.
- Resolved issues with duplicated or missing characters when selecting from IME suggestions.
- Existing characters are now preserved during IME-based editing.
- Improved toolbar and side panel layout and usability. (DOC-6411)
- Toolbar layout:
- New default items order:
- View mode: `Open`, `Save`, `Print`, `Search`.
- Edit mode: added `Open` before `Save`.
- `FullScreen` and `Themes` removed from default layout.
- `ExtractTable` moved to side panel.
- Side panel:
- New default items order: `DocumentList`, `SharedDocuments`, `Search`, `Thumbnails`, `Outline`, `StructureTree`, `Articles`, `Layers`, `Attachments`, `ExtractTable`.
- `ExtractTable` icon updated.
- Page Navigation control:
- Visual changes:
- Page navigation input is now more compact.
- First/last page buttons are hidden by default.
- Page counter display logic improved.
- Added keyboard shortcuts when the page input box is in focus:
- ←/→: page up/down when the caret is at first/last position in the control.
- ↑/↓: page up/down.
- Home/End: jump to first/last page.
- Enter: submit manual page number entry.
- Esc: cancel input.
- New semantic CSS classes (previously non-customizable):
- .gc-btn.go-to-first
- .gc-btn.go-to-last
- .current-page-input
- .gcv-page-input__text
- Reverting to old appearance and layout:
- To revert to old page navigator appearance:
```javascript
const viewer = new DsPdfViewer('#viewer', {
navigation: {
showFirstButton: true,
showLastButton: true,
pageInputWidth: 100,
buttonSizing: 'standard'
}
});
```
- To revert to old side panel layout:
```javascript
viewer.layoutPanels([
'DocumentList', 'SharedDocuments', 'Thumbnails', 'Search', 'Outline',
'ExtractTable', 'Layers', 'StructureTree', 'Attachments', 'Articles', 'sep',
'AnnotationEditor', 'FormEditor'
]);
```
- To revert to old toolbar layouts:
```javascript
// Main viewer toolbar:
const viewerButtons = {
default: ['open', '$navigation', '$split', 'text-selection', 'pan', 'zoom', '$fullscreen', '$split', 'text-tools', 'draw-tools', 'attachment-tools',
'form-tools', 'page-tools', '$split', 'rotate', 'page-display', 'theme-change', 'print', 'save-as', 'hide-annotations', 'form-filler', 'extract-table', 'search',
'doc-title', 'doc-properties', 'about'],
fullscreen: ['$fullscreen', '$navigation', '$split', 'open', 'text-selection', 'pan', 'zoom', '$split', 'text-tools', 'draw-tools', 'attachment-tools',
'form-tools', 'page-tools', '$split', 'rotate', 'page-display', 'theme-change', 'print', 'save-as', 'hide-annotations', 'form-filler', 'extract-table', 'search',
'doc-title', 'doc-properties', 'about'],
mobile: ['open', '$navigation', '$split', 'text-selection', 'pan', 'zoom', '$fullscreen', '$split', 'text-tools', 'draw-tools', 'attachment-tools', 'form-tools',
'page-tools', '$split', 'rotate', 'page-display', 'theme-change', 'print', 'save-as', 'hide-annotations', 'form-filler', 'extract-table', 'search', 'doc-title',
'doc-properties', 'about']
};
// Annotation editor toolbar:
const annotationEditorButtons = {
default: ['edit-select', 'save-as', 'share', 'edit-sign-tool', '$split', 'edit-text', 'edit-free-text', 'edit-ink', 'edit-square',
'edit-circle', 'edit-line', 'edit-polyline', 'edit-polygon', 'edit-stamp', 'image-list', 'edit-file-attachment', 'edit-richmedia', 'edit-sound', 'edit-link',
'edit-highlight', 'edit-underline', 'edit-squiggly', 'edit-strike-out',
'$split', 'edit-redact', 'edit-redact-apply', 'edit-erase', '$split', 'edit-undo', 'edit-redo', '$split', 'new-document', '$split', 'new-page', 'delete-page',
'$split', 'pdf-organizer'],
fullscreen: ['$fullscreen', 'edit-select', 'save-as', 'share', 'edit-sign-tool', '$split', 'edit-text', 'edit-free-text', 'edit-ink', 'edit-square',
'edit-circle', 'edit-line', 'edit-polyline', 'edit-polygon', 'edit-stamp', 'image-list', 'edit-file-attachment', 'edit-richmedia', 'edit-sound', 'edit-link',
'edit-highlight', 'edit-underline', 'edit-squiggly', 'edit-strike-out',
'$split', 'edit-redact', 'edit-redact-apply', 'edit-erase', '$split', 'edit-undo', 'edit-redo', '$split', 'new-document', '$split', 'new-page', 'delete-page',
'$split', 'pdf-organizer'],
mobile: ['edit-select', 'save-as', 'share', 'edit-sign-tool', '$split', 'edit-text', 'edit-free-text', 'edit-ink', 'edit-square', 'edit-link',
'edit-highlight', 'edit-underline', 'edit-squiggly', 'edit-strike-out',
'edit-circle', 'edit-line', 'edit-polyline', 'edit-polygon', 'edit-stamp', 'image-list', 'edit-file-attachment', 'edit-richmedia', 'edit-sound',
'$split', 'edit-redact', 'edit-redact-apply', 'edit-erase', '$split', 'edit-undo', 'edit-redo', '$split', 'new-document', '$split', 'new-page', 'delete-page',
'$split', 'pdf-organizer']
};
// Forms editor toolbar:
const formEditorButtons = {
default: [
'edit-select-field', 'save-as', 'share', '$split',
'edit-widget-tx-field', 'edit-widget-tx-password', 'edit-widget-tx-text-area', 'edit-widget-btn-checkbox', 'edit-widget-btn-radio',
'edit-widget-btn-push', 'edit-widget-ch-combo', 'edit-widget-ch-list-box', 'edit-widget-tx-comb', 'edit-widget-btn-submit', 'edit-widget-btn-reset',
'$split', 'edit-erase-field', '$split', 'edit-undo', 'edit-redo', '$split', 'new-document', '$split', 'new-page', 'delete-page', '$split', 'pdf-organizer'],
fullscreen: ['$fullscreen', 'edit-select-field', 'save-as', 'share', '$split',
'edit-widget-tx-field', 'edit-widget-tx-password', 'edit-widget-tx-text-area', 'edit-widget-btn-checkbox', 'edit-widget-btn-radio',
'edit-widget-btn-push', 'edit-widget-ch-combo', 'edit-widget-ch-list-box', 'edit-widget-tx-comb', 'edit-widget-btn-submit', 'edit-widget-btn-reset',
'$split', 'edit-erase-field', '$split', 'edit-undo', 'edit-redo', '$split', 'new-document', '$split', 'new-page', 'delete-page', '$split', 'pdf-organizer'],
mobile: ['edit-select-field', 'save-as', 'share', '$split',
'edit-widget-tx-field', 'edit-widget-tx-password', 'edit-widget-tx-text-area', 'edit-widget-btn-checkbox', 'edit-widget-btn-radio',
'edit-widget-btn-push', 'edit-widget-ch-combo', 'edit-widget-ch-list-box', 'edit-widget-tx-comb', 'edit-widget-btn-submit', 'edit-widget-btn-reset',
'$split', 'edit-erase-field', '$split', 'edit-undo', 'edit-redo', '$split', 'new-document', '$split', 'new-page', 'delete-page', '$split', 'pdf-organizer'],
};
viewer.toolbarLayout = {
viewer: viewerButtons,
annotationEditor: annotationEditorButtons,
formEditor: formEditorButtons,
stickyBehavior: []
};
```
- Enabled tooltip display for disabled buttons in the toolbar and sidebar.
- Various minor UI improvements.
### Fixed
- Addressed several minor issues and inconsistencies.
## [8.1.5] - 04-Aug-2025
### Changed
- Enabled use of a custom jsxFactory by removing the dependency on react.d.ts. (DOC-6946)
### Fixed
- Fixed an issue where Ctrl+Home and Ctrl+End keyboard shortcuts did not work in single page view. (DOC-6956)
- Fixed an issue where pressing Ctrl+Enter during the initial creation of a FreeText annotation was ignored. (DOC-6958)
- [Wasm] Fixed incorrect processing of PDFs where the same content stream was reused multiple times on the same page. (DOC-7001)
## [8.1.4] - 25-Jun-2025
### Fixed
– [Regression since v8.1.2] [Chromium v131+ Desktop] Incorrect text kerning for certain fonts when rendering PDFs. (DOC-6936, DOC-6944)
## [8.1.3] - 06-Jun-2025
### Fixed
- Grouped Highlights not rendered in DsPdfViewer. (DOC-6921)
### Changed
- JPN localization updated. (DOC-6914)
## [8.1.2] - 23-May-2025
### Fixed
- Request to add @Ignore tag to APIs that do not need to generate public API documentation. (DOC-6869)
- [Chromium v131+ Android] Resolved PDF rendering issues on Android Chrome versions 131.0.6778.104 and later. (DOC-6901)
- [Wasm] Minor bug fixes.
## [8.1.1] - 09-May-2025
### Fixed
- [Regression since v8.1.0] Sound annotations do not play when double-clicked. (DOC-6897)
## [8.1.0] - 10-Apr-2025
### Added
- [Editor] Table data extractor tool (requires server-side SupportApi): finds and extracts tabular data from a region selected by the user.
The data can be copied to clipboard or saved to a file in different formats including CSV, TSV, JSON, XLSX, XML or HTML. (DOC-5185)
- [Wasm] Added support for redact, export to PNG, converting annotations to content and PDF linearize (fast Web view) to client-side (Wasm) SupportApi. (DOC-6388)
- Added support for the PDF sound action. (DOC-6738)
### Changed
- [Editor] Improved the 'Text' property editor (always show the value, allows for easier editing). (DOC-6740)
### Fixed
- Text selection is not visible in Safari Browser on IOS 18. (DOC-6822)
## [8.0.6] - 2-Apr-2025
### Added
- Option to send PDFs containing pages with different orientations to the browser print preview as a single job. (DOC-6854)
```javascript
// Enable single print job mode to force all pages to be printed together:
var viewer = new DsPdfViewer("#root", {
printSingleJobMode: true
});
```
### Fixed
- [Wasm] Position of annotations changes when saving the document using Wasm support API. (DOC-6848)
## [8.0.5] - 20-Mar-2025
### Added
- Added support for cancelling the onBeforeOpen event. (DOC-6755)
### Fixed
- [Regression since v8.0.4] Loading PDFs is very slow in FireFox browser. (DOC-6814)
- Typings of modules i18next and moment are missing in DsPdfViewer installation. (DOC-6778)
- The viewer zoom factor changes when the layout mode is changed. (DOC-6554)
- 'TypeError: Cannot read properties of null' can occur in specific scenarios. (DOC-6846)
## [8.0.4] - 27-Feb-2025
### Changed
- [Reply Tool] Enabled adding replies and statuses to locked annotations. (DOC-6773)
### Fixed
- [Reply Tool] Fixed a permission check issue when deleting a reply using the Delete key. (DOC-6773)
- TypeError when clicking on the page with ReplyTool enabled. (DOC-6753)
- DsPdfViewer container element does not scroll if there is no PDF in the viewer. (DOC-6766)
- [API Docs] Some code examples formatting is incorrect. (DOC-6768, DOC-6769, DOC-6772)
- [iOS 17] Specific PDF fails to load on iOS 17.5 (loads fine on iOS 18.0 and above). (DOC-6724)
## [8.0.3] - 09-Feb-2025
### Added
- [Reply Tool] Automatic focusing on the clicked annotation in the replies list. Now, when you click on an annotation, the corresponding entry in the replies list will be focused and brought into view.
- [Reply Tool] Added new Reply Tool event bus events. (DOC-6732)
- replytool-before-delete: triggered before an annotation is deleted using the Reply Tool. This event is cancelable, allowing prevention of deletion.
- replytool-before-scrollintoview: triggered before the Reply Tool scrolls to a reply item’s HTML element. This event is cancelable, enabling control over the scrolling behavior.
- replytool-text-label-click: triggered when the user clicks a text label, before executing the associated Reply Tool actions (e.g., displaying the inline text editor for editable annotations). This event is cancelable, allowing customization or prevention of the default behavior.
- replytool-item-click: triggered when the user clicks a list item in the Reply Tool, either a parent note item or a reply item. The event can be canceled by setting the cancel property of the event arguments object to true.
- replytool-item-keydown: triggered when the user presses a key while a list item in the Reply Tool is focused (either a parent note item or a reply item). The event can be canceled by setting the cancel property of the event arguments object to true, preventing the default Reply Tool behavior.
- replytool-placeholder-activate: triggered when the user activates the reply placeholder by clicking on it or pressing any key while it is focused. The event can be canceled by setting the cancel property of the event arguments object to true, preventing the default Reply Tool behavior (e.g., opening the reply editor).
- replytool-author-label-click: triggered when the user clicks the author label, before executing the associated Reply Tool actions (e.g., opening the inline text editor for editable annotations). The event can be canceled to prevent the default behavior.
- replytool-item-status-change: triggered when the user changes the status of a reply annotation. It can be canceled by setting args.cancel to true. The event also allows overriding the target annotation using args.annotation or modifying the status via args.status. Possible statuses: 'None', 'Accepted', 'Cancelled', 'Completed', 'Rejected'.
- replytool-post-reply: triggered when the user adds a reply annotation via the "Post Reply" button or by pressing Ctrl+Enter after editing the reply text. The event can be canceled by setting args.cancel to true and allows modifying the reply annotation using args.annotation.
```javascript
// Example:
viewer.eventBus.on("replytool-before-delete", function(args) {
// Check if the entire annotation is being deleted (not just a comment)
if (!args.removeCommentOnly) {
// Confirm deletion with the user
if (!confirm("Are you sure you want to delete the annotation with ID " + args.annotation.id + "?")) {
// Cancel the deletion if the user declines
args.cancel = true;
}
}
});
```
- Added annotationFilter option for Reply Tool.
Allows customizing which annotations are displayed in the Reply Tool by providing a filter function.
```javascript
// Example: show only text annotations in the Reply Tool
var viewer = new DsPdfViewer("#root", {
replyTool: {
annotationFilter: (annotation) => annotation.annotationType === 1 // AnnotationType.TEXT
}
});
```
### Changed
- JPN localization updated. (DOC-6727)
- [Reply Tool] Improved behavior for annotations without comments. (DOC-6718)
- The "Add a comment..." placeholder is now hidden unless the annotation is selected or focused.
### Fixed
- Incorrect document display at high zoom values. (DOC-6728)
- [Reply Tool] Incorrect position of timestamp for the reply in the Reply Tool panel. (DOC-6716)
- [Reply Tool] The comment popup behaves incorrectly if the Reply Tool and other toolbars are used together. (DOC-6729)
- [Reply Tool] Issues with styling in Dark and Dark-Yellow Themes. (DOC-6737)
- [Reply Tool] Inconsistent behavior when deleting comments for annotations other than sticky notes. (DOC-6735)
- [Layers] Incorrect display of PDF layers in some cases. (DOC-6733)
- [Reply Tool] Issue with Reply Tool styling in Dark & Dark-Yellow Themes. (DOC-6737)
- [Reply Tool] The comment popup gets broken if reply tool and other toolbars are used together. (DOC-6729)
## [8.0.1] - 25-Dec-2024
### Added
- Added text selection capability to FreeText annotations. (DOC-6659)
### Fixed
- Proximity search like ["My favorite" ONear(1) "is" ONear(5)"."] does not work as expected. (DOC-6579)
- Open search panel stops working when another document is picked from the document list. (DOC-6666)
- The same text can be replaced several times. (DOC-6674)
## [8.0.0] - 03-Dec-2024
### Added
- Added text replace feature: use Ctrl+H to open the search bar in replace mode, or click the expand button in the search bar to toggle between search and replace modes. (DOC-5200)
- Added display of timestamps in user comments. (DOC-6233)
- [Reply Tool] Added useRelativeDates and dateFormat options. (DOC-6586)
```javascript
// Example 1: Disable relative dates and use absolute dates instead.
var viewer = new DsPdfViewer("#root", { replyTool: { useRelativeDates: false } });
// Example 2: Use a custom format for absolute dates.
var viewer = new DsPdfViewer("#root", { replyTool: { useRelativeDates: false, dateFormat: "yyyy.mm.dd HH:MM" } });
```
- Added hidePopupTimestamp option. (DOC-6587)
### Changed
- Enhanced proximity search with support for NEAR and ONEAR operators, added the ability to quote phrases for "full phrase" proximity search. (DOC-6390)
### Fixed
- [CommentTimeStamp] Incorrect handling of future dates in relative date formatting. (DOC-6588)
## [7.2.4] - 23-Oct-2024
### Added
- Enabled two-finger scrolling while drawing ink annotations. (DOC-6537)
### Fixed
- Save as SVG dialog message is not JPN localized. (DOC-6557)
- Using Ctrl+R to refresh the page is always handled by DsPdfViewer. (DOC-6548)
## [7.2.3] - 02-Oct-2024
### Changed
- JPN localization updated. (DOC-6514)
## [7.2.2] - 19-Sep-2024
### Changed
- The updateAnnotation and addAnnotation methods will now throw an error if the provided annotation object is improperly formed and cannot be used. (DOC-6506)
- [Documentation] The gcProps property has been moved from the base AnnotationBase class to the more specific WidgetAnnotation class. (DOC-6506)
### Fixed
- The behavior is inconsistent when double-clicking a redact annotation. (DOC-6503)
- [iOS] Cannot scroll by swiping while entering ink annotations. (DOC-6501)
## [7.2.1] - 28-Aug-2024
### Added
- Added the ability to create field widgets with the same name, enabling such widgets to update their values simultaneously. (DOC-6461)
- Added new API method repaintTextLayer for efficiently repainting text selection and highlighting elements on visible pages.
- Added highlightTextSegment method to enable highlighting specific text segments on a page with customizable options for color and style.
- Added clearHighlightedSegments method to remove all custom text highlights from a specified page.
- Added `newDocumentFileName` option to specify the default file name when creating new documents in the viewer. This is distinct from `friendlyFileName`, which names existing documents.
### Fixed
- [Wasm] Save API method did not recognize spaces as separators (commas worked fine). (DOC-6425)
- Unexpected content appears in a form field. (DOC-6420)
- Input widgets associated with the same field behave incorrectly. (DOC-6412, DOC-6415)
- Part of a combo text box's content is lost. (DOC-6356)
- [Form Editor] Cannot create multiple input fields with same name. (DOC-6416)
- In two pages side by side view, PageWidth zoom mode scales to single page width. (DOC-6476)
- Data using time format is not rendered correctly. (DOC-6482)
- Markup shows at incorrect locations in some browsers. (DOC-6474)
## [7.2.0] - 07-Aug-2024
### Added
- Added Wasm SupportApi option, it enables PDF editing features on the client without connecting to SupportApi/DsPdf on a server.
```javascript
// Example: use client-side Wasm SupportApi:
function loadPdfViewer(selector) {
var viewer = new DsPdfViewer(selector, {
supportApi: {
implementation: new WasmSupportApi()
}
});
viewer.addDefaultPanels();
viewer.addAnnotationEditorPanel();
viewer.addFormEditorPanel();
}
```
- Added registerFont method: registers a new @font-face style with the given font name and URL.
Supported font formats include "ttf", `otf`, "woff" and "woff2" ("woff2" is not supported by the Wasm SupportApi).
```javascript
// Example 1: Registering a font with name and URL
viewer.registerFont('CustomFont', 'https://example.com/fonts/customfont.woff');
// Example 2: Registering a font with name, URL, and format
viewer.registerFont('AnotherFont', 'https://example.com/fonts/anotherfont.ttf', 'ttf');
```
- Added registerFallbackFont method: registers a fallback font that SupportApi will use when searching for fallback fonts.
Supported font formats include "ttf", "otf", "woff", and "ttc". Font collections in "ttc" format are also supported.
```javascript
// Example 1: Registering a fallback font with URL:
viewer.registerFallbackFont('https://example.com/fonts/fallbackfont.ttf');
// Example 2: Registering a fallback font with name and URL:
viewer.registerFallbackFont('SampleFont', 'https://example.com/fonts/SampleFont.woff');
```
- Added support for the standard "Zapf Dingbats" font, which can now be selected for text fields and free text annotations.
- Added a "Save As" button with the toolbar button key "save-as".
Use the "Save As" button to export the PDF document to various formats (PDF, PNG, SVG).
The old "Save" and "Save as images" buttons have been removed from the default toolbar layout.
- Added the ability to export a PDF document to SVG images.
- Added extended support for pageLayout mode based on initial viewer preferences specified in a PDF document.
The following pageLayout values specified in the PDF correspond to pageDisplay values in the viewer:
* TwoColumnLeft: sets pageDisplay to TwoPageScrolling.
* TwoColumnRight: sets pageDisplay to TwoPageScrolling.
* TwoPageLeft: sets pageDisplay to TwoPage.
* TwoPageRight: sets pageDisplay to TwoPage.
* OneColumn: sets pageDisplay to SinglePageScrolling.
* SinglePage: sets pageDisplay to SinglePage.
- Added support for an ECMAScript action that can be performed before the field is formatted to display its value. (DOC-5643)
- Added support for two pages side by side view. (DOC-6063)
### Changed
- The standard "Symbol" font now saves correctly and displays properly in most PDF viewers.
- [Toolbar] The "View Mode" button has been replaced with the "Page Display" dropdown menu. (DOC-6063)
- [Text Tools] Added the ability to create text markup annotations directly from selected text when text is selected.
### Fixed
- [PDF Organizer] Page ranges were not created in some scenarios. (DOC-6345)
## [7.1.4] - 23-Jul-2024
### Added
- Added progress bar for long-running "Save as Images" operations, with the ability to cancel the current operations. (DOC-6301)
- JPN localization. (DOC-6297)
### Fixed
- [Regression since v7.1.3] Saved PDF file name is different from the argument passed to the viewer.save() API. (DOC-6374)
- [macOS] Comment cannot be deleted with Delete key on macOS. (DOC-6152)
- Incorrect content of PDF while previewing on Ionic Modal. (DOC-6209)
## [7.1.3] - 25-Jun-2024
### Fixed
- Thumbnails are not shown when exiting full screen mode with 'NonFullScreenPageMode' set to 'UseThumbs'. (DOC-6293)
- [PDF.js vulnerability] Malicious JavaScript can run in PDF viewer's WebWorker via crafted PDF file. (DOC-6248)
### Changed
- The required version of SupportApi has been changed to v7.1.3.
## [7.1.2] - 27-May-2024
### Fixed
- Cannot save a PDF if its name contains certain non-Latin characters. (DOC-6222)
- Localization doesn't work when the specified language is not all in lowercase. (DOC-6230)
- Full-screen mode incorrectly enabled for some PDFs without full-screen mode preference. (DOC-6243)
## [7.1.1] - 23-Apr-2024
### Fixed
- Cannot edit password-protected PDF when copying content is disabled. (DOC-6116)
- Comment added in the comment panel is not wrapped. (DOC-6134)
- Incorrect resize bar position. (DOC-6188)
- Auto-sized font appears larger than the required font size in some PDFs (additional fixes). (DOC-6029)
- [Collaboration] Only one page of a newly created PDF is shared. (DOC-4143)
## [7.1.0] - 04-Apr-2024
### Fixed
- Cannot submit comment by pressing the Enter kay on the 'Done' button. (DOC-6109)
- Issues with loading large files. (DOC-6080, DOC-6082)
- Edit mode is not deactivated when switching the viewer layout from annotation editor while the second toolbar is open. (DOC-6074)
- Searching for a text also highlights the space before the found text. (DOC-6142)
### Changed
- Enhanced the behavior and appearance of the context menu, added the ability to add a note to selected text. (DOC-6100)
- Removed text markup menu that automatically popped up on text selection. The main context menu includes that menu as a submenu.
- Added the `showContextMenuOnSelection` option controlling the context menu behavior when text is selected.\
The option has the following values:
* "Auto": Automatically determines whether to show the context menu based on the device type.
* "On": Always shows the context menu when text is selected.
* "Off": Never shows the context menu when text is selected.\
The default value is "Auto". On systems with mice, "Auto" behaves like "Off".
On small devices (phones, tablets) without mice, "Auto" behaves like "On".
- [Reply Tool] Updated context menu texts. (DOC-6014)
### Added
- Added support for rich media annotations (play embedded audio/video, modify rich media annotations). (DOC-5979)
- Reply Tool Improvements:
* Added the ability to delete a comment item using the Delete key. Enabled navigation through comment items using the TAB and Arrow keys.
* Added the ability to resize the right sidebar element.
* The Reply Tool now activates automatically when a markup annotation or text comment is added via the context menu, focusing on the new comment in the list.
```javascript
// Use autoExpandOnCommentAdd option to revert to previous behavior:
var viewer = new DsPdfViewer("#root", { replyTool: { autoExpandOnCommentAdd: false } });
```
* The color for ReplyTool icons has been removed.
```javascript
// Use useColoredIcons option to revert to previous behavior:
var viewer = new DsPdfViewer("#root", { replyTool: { useColoredIcons: true } });
```
- Split ISupportApi into base and multi-user parts, added the ability to specify a custom implementation for SupportApi that conforms to the ISupportApiBase interface. (DOC-5440)
```javascript
// Example
var viewer = new DsPdfViewer("#root", {
supportApi: {
implementation: new CustomSupportApi()
}
});
```
## [7.0.4] - 20-Mar-2024
### Fixed
- Incorrect appearance of a rotated stamp annotation. (DOC-6059)
- After calling dispose() method, viewer reserved keys still do not work correctly. (DOC-6060)
- Ellipsis is displayed in the floating search bar's settings when the system language is not English and the language option is not specified. (DOC-6067)
## [7.0.3] - 19-Feb-2024
### Added
- Added new option 'printResolution' (DOC-5995).\
The 'printResolution' option allows you to specify the resolution (in dots per inch - DPI) for printing purposes.
When rendering and preparing a PDF documents for printing, this option determines the quality and detail of the
generated images used in the printing process. A higher DPI value generally results in crisper and more detailed
printed output but may also lead to larger memory usage and slower preview performance. The default value is 150 DPI.
```javascript
// Example: set the print resolution to 300 DPI:
var viewer = new DsPdfViewer("#root", {
printResolution: 300
});
```
### Fixed
- In single page view mode, ItemArea for search results is NaN on Page 2. (DOC-6017)
- The search settings dialog is not closed after closing the floating search bar. (DOC-6021)
- Auto-sized font appears larger than the required font size in some PDFs. (DOC-6029)
- Unable to input "c" and "x" characters in CombTextField. (DOC-6035)
## [7.0.2] - 25-Jan-2024
### Fixed
- Floating text search window display issues in some locales. (DOC-5996)
- Incorrect display of some fonts. (DOC-5983)
- Searched text is not visible in the viewport. (DOC-5965)
- [SupportApi] Resources are not released when the viewer is disposed. (DOC-5733)
- Concurrency issue in the addAnnotation() method. (DOC-6010)
- [Search API] SearchResult.ItemArea is empty. (DOC-6000)
## [7.0.1] - 04-Jan-2024
### Added
- Added standardFontDataUrl option: the URL where the standard font files are located. Include the trailing slash. (DOC-5959)
```javascript
// Example with relative URL:
var viewer = new DsPdfViewer("#root", { standardFontDataUrl: "resources/standard_fonts/" });
// Example with absolute URL:
var viewer = new DsPdfViewer("#root", { standardFontDataUrl: "http://localhost:8080/resources/standard_fonts/" });
```
- Added Chinese localization. (DOC-5856)
```javascript
// Example:
var viewer = new DsPdfViewer("#root", { language: "cn" });
```
### Changed
- JPN localization updated. (DOC-5948)
- License messages updated. (DOC-5951, DOC-5953)
### Fixed
- ComboBox: the first available option value displayed when field is empty. (DOC-5954)
- Console warnings about missing standard font files. (DOC-5969)
- Extra pages are added to the PDF in print preview when the HTML page contains elements with static positioning. (DOC-5895)
- Some incorrectly formed annotations are not shown. (DOC-5986)
## [7.0.0] - 07-Dec-2023
### Added
- Added DsPdfViewer class and "@mescius/dspdfviewer" package. Functionally DsPdfViewer is identical to GcPdfViewer. (DOC-5735)
- Added floating text search bar. (DOC-5406)
- Added localization resources and a localization example to the pdf viewer build.
- Added new option useFloatingSearchBar - enable a floating search bar instead of the sidebar search panel. Default value is true.
```javascript
// To revert to using sidebar search panel instead of the floating search bar:
var viewer = new DsPdfViewer("#root", { useFloatingSearchBar: false });
```
### Changed
- Some tooltips updated.
## [4.2.5] - 22-Nov-2023
### Fixed
- Cannot resize annotations and form fields in some PDFs. (DOC-5396)
- [Ionic Framework] Error "PDF Viewer Factory is not ready." occurs for Ionic Modal. (DOC-5826)
- [Search Panel] Text highlighting disappears when clicking on a document. (DOC-5838)
- [Editor] Problem when moving a stamp annotation to another page using the context menu. (DOC-5844)
### Changed
- [Editor] Improved the floating bar containing the caret/hand options (added close button, reduced size).
- Enhanced the default HTML template index.html (added a description for SupportApi settings).
### Added
- Localizable string resources and example for localization are now included in the package.
## [4.2.4] - 27-Oct-2023
### Fixed
- When a stamp annotation is moved to another page, the resulting position is incorrect. (DOC-5728)
- The annotation position is changed on saving changes after locking the annotations. (DOC-5732)
- [demos] Viewer API is not visible correctly with Window Dark Mode. (DOC-5721)
## [4.2.3] - 28-Sep-2023
### Fixed
- Clicking on a link in a PDF opens a blank page. (DOC-5709)
- [Windows Touch] Zooming by hand does not work. (DOC-5633)
## [4.2.2] - 13-Sep-2023
### Changed
- Localization resources updated. (DOC-5651)
### Fixed
- [Regression] "Cannot find type definition" error when compiling a typescript enabled app. (DOC-5688)
- [Regression] Issues with displaying info messages from the viewer. (DOC-5690)
- Comments added by Adobe Acrobat Reader are not shown correctly when the renderInteractiveForms option is false. (DOC-5693)
- Annotations with AnnotationFlags.NoView are displayed. (DOC-5697)
## [4.2.1] - 17-Aug-2023
### Fixed
- [Editor] After saving a free text annotation with a custom font, the font in the saved PDF is incorrect. (DOC-5642)
### Changed
- Localization resources updated. (DOC-5651)
### Added
- [Editor] Ability to use custom fonts in saved PDFs, see CHANGELOG.​md shipped with GrapeCity.Documents.Pdf.ViewerSupportApi for details. (DOC-5652)
- [Editor] Auto-adjusting font size of text boxes: if the font size is zero, it will be automatically adjusted to fit the content of the text box. (DOC-5558)
## [4.2.0] - 01-Aug-2023
### Fixed
- Content of some password-protected PDF documents is not displayed. (DOC-5623)
- The name of a document list item changed from lower to upper case. (DOC-5602)
- [iOS Desktop] PDF text cannot be selected on zooming the document. (DOC-5432)
- Miscellaneous UI improvements. (ARF-4244, DOC-5608, DOC-5638)
### Added
- Added the ability to use an async function as a "beforeFormSubmit" handler. (DOC-5589)
```javascript
// Example:
viewer.options.handlers = {
beforeFormSubmit: async function(args) {
// Wait 5 seconds before submit:
await new Promise(resolve => setTimeout(resolve, 5000));
args.cancel = true;
alert("5 seconds passed. Submit canceled.");
}
};
```
- [Document List Panel] Added the ability to specify html content for document list items. (DOC-5367)
- [Collaboration] Added new methods: getSharedDocuments, openSharedDocumentByName, openSharedDocumentByIndex. (DOC-5457)
```javascript
// Example 1: get the list of shared documents available to the current user:
var sharedDocuments = await viewer.getSharedDocuments();
// Example 2: open the first available shared document named "example.pdf":
viewer.openSharedDocumentByName("example.pdf");
// Example 3: open the second shared document in the list:
viewer.openSharedDocumentByIndex(1);
```
## [4.1.5] - 14-Jul-2023
### Fixed
- Image cache not functioning correctly when navigating from the first page. (DOC-5564)
- A signature with an appearance stream is not visible. (DOC-5547, DOC-5578)
- [iOS] [iOS Desktop mode] [Android] Pinch zoom in on a link redirects the page. (DOC-5560)
- [Editor] Free text annotation's text changes after repaint. (DOC-5573)
- Multiline text cannot be entered in free text & sticky note annotations. (DOC-5468)\
(Note that note that Adobe Acrobat does not support line breaks for plain text in text annotations.
If line breaks are detected during editing, we automatically set the rich text flag for the text annotation.)
- When several lines of text are selected to create a markup annotation, a separate annotation is created for each line. (DOC-5503)
- Incorrect display on the second page when viewing a specific PDF. (DOC-5496)
- Incorrect handling of rich text when text markup is entered in a text annotation. (DOC-5551)
- Incorrect field names on calling the viewer.submitForm() method. (DOC-5553)
- [Editor] Content missing when opening a PDF on an IOS devices. (DOC-5407)
- [iOS] Incorrect context menu position when context menu is triggered by keyboard. (DOC-5555)
- [iOS] [Android] Pinch zoom in on a link is redirecting the page. (DOC-5560)
### Changed
- Improved the behavior of free text annotations. (DOC-5368)
## [4.1.4] - 20-Jun-2023
### Fixed
- Improved handling of JavaScript code associated with widget events. (DOC-5475)
- [Windows Touchpad] In PDF Organizer, cannot dragged pages using the touchpad. (DOC-5465)
## [4.1.3] - 31-May-2023
### Fixed
- A typing error is thrown when adding stamps in code in an Angular app. (DOC-5433)
## [4.1.2] - 08-May-2023
### Added
- [Form editor] Added tooltip support for all fields, added "Field tooltip" property editor. (DOC-5384)
- Added addStamp method. (DOC-5376)
```javascript
// Example: add graphical signature to the PDF using external image:
function addStampFromUrl(imageUrl, viewer) {
fetch(imageUrl)
.then(response => response.blob())
.then(blob => blob.arrayBuffer())
.then(arrayBuffer => {
const fileId = new Date().getTime() + ".png";
const fileName = fileId;
const pageIndex = 0;
const imageData = new Uint8Array(arrayBuffer);
const rect = [0, 0, 200, 200];
viewer.storage.setItem(fileId, imageData);
viewer.addStamp(
imageData,
{
fileId,
fileName,
pageIndex,
rect,
select: false,
subject: "",
rotate: 0,
convertToContent: false
});
});
}
addStampFromUrl("http://example.com/image.png", viewer);
```
- Added jsExecutionConfig option: optional execution configuration for JavaScript actions.
```javascript
// Example 1: adjust jsCode before execution:
viewer.options.jsExecutionConfig = {
before: function(args) {
args.jsCode = args.jsCode.replace("app.alert", "app.showMessage");
}
}
// Example 2: cancel JS execution:
viewer.options.jsExecutionConfig = {
before: function(args) {
args.cancel = true;
}
}
// Example 3: execute long operation before JS execution and repaint visible pages after JS execution:
viewer.options.jsExecutionConfig = {
before: function() {
// Returned promise will be awaited before further JS execution.
return new Promise(function(resolve) {
setTimeout(resolve, 1000);
});
},
after: function() {
viewer.repaint();
}
}
```
### Changed
- [Editor] Updated property labels for field widgets: property "Name" renamed to "Field name", property "Value" renamed to "Field value", property "Export Value" renamed to "Choice value".
### Fixed
- The second toolbar position is not updated in some cases. (DOC-5377)
- [iOS] When a signature is drawn by Apple Pencil, a lens is sometimes displayed. (DOC-5370)
- [iOS] Locking all fields does not lock some properties. (DOC-5299)
- [iOS] Several issues when using the PDF Organizer. (DOC-5344, DOC-5345)
- Stamp annotations in some PDFs incorrectly appear rotated. (DOC-5383)
- Cannot copy a layer name from the Layers panel. (DOC-5385)
- Cannot load a stamp generated from an image. (DOC-5379)
- JavaScript actions' sequence is incorrect for focus/blur events. (DOC-5389)
- Localization issues. (DOC-5359)
- [Editor] Incorrect popup annotation orientation is some cases. (DOC-5386)
## [4.1.1] - 17-Apr-2023
### Fixed
- [Regression] [Editor] 'Support API server version 6.1.0 is out of date' warning incorrectly shows when the viewer is connected to SupportApi v6.1.0. (DOC-5374)
## [4.1.0] - 03-Apr-2023
### Added
- PDF Organizer: new feature that allows users to rearrange, duplicate or remove pages of a PDF, or merge PDFs. (DOC-3914, DOC-3915, DOC-3916)\
To open the PDF Organizer dialog, in the top toolbar click 'Page Tools', and in the secondary toolbar click 'PDF Organizer'.
- Respect PDF's initial view settings (hide toolbars or menus, open with specific page layout, etc). (DOC-4667)
- Added ignoreInitialView option: set this option to true to ignore initial view settings specified in PDFs.
```javascript
// Example:
viewer.options.ignoreInitialView = true;
```
- Added support for zoom-dependent optional content (layers). (DOC-3970, DOC-4108)
- Added the ability to specify a custom progress message during save action.
```javascript
// Example: use your own progress title and message:
viewer.save("sample.pdf", { pages: "[angle:90]0,1-5", progressTitle: "Rotating", progressMessage: "Rotating first page..." }, reload: true);
```
- Added new method resolvePageIndex(): resolves the page index using PDF page reference. (DOC-5214)
```javascript
// Example:
const openAction = (await viewer.viewerPreferences).openAction;
if(openAction && openAction.dest) {
const pageRef = openAction.dest[0];
const targetPageIndex = await viewer.resolvePageIndex(pageRef);
}
```
- Added holdToPan action: press and hold the spacebar to temporarily enable the pan tool.
```javascript
// Example 1: disable holdToPan when space is pressed:
viewer.options.shortcuts["32"] = () => {};
// Example 2: bind P to holdToPan action, keep Ctrl+P bound to print action:
viewer.options.shortcuts["P"] = [{ ctrl: true, tool: "print" }, { tool: "holdToPan" }];
```
### Changed
- 'Layers' and 'StructureTree' panels added to the default sidebar layout, 'Articles' panel removed.
The default set of sidebar panels is now as follows: 'Thumbnails', 'Search', 'Outline', 'Layers', 'StructureTree', 'Attachments'.
```javascript
// Example: restore the old default layout:
var viewer = new GcPdfViewer("#root");
viewer.addArticlesPanel();
viewer.addThumbnailsPanel();
viewer.addSearchPanel();
viewer.addOutlinePanel();
viewer.addAttachmentsPanel();
```
- [Editor] The printable flag is now set to true for all new annotations.
- Returning model type for the viewer.viewerPreferences property changed: all property names are now camelCased, new properties added: openAction, pageMode, pageLayout.
- Reduced the heights of dialogs' title bars. (DOC-5313)
- [Editor] Text annotation (sticky note) properties display improved. (DOC-3241)
## [4.0.7] - 07-Apr-2023
### Changed
- hideAnnotationPopups option improved: the option now allows specifying annotation types that won't show popups. (DOC-5283)\
Possible values are:
['Text', 'Link', 'Line', 'Square', 'Circle', 'Polygon', 'PolyLine', 'Ink', 'Popup', 'FileAttachment', 'Sound', 'Redact', 'Stamp'] or true or 'All' (true and 'All' have the same behavior).
```javascript
// Example 1: hide popups for all annotations:
var viewer = new GcPdfViewer("#root", { hideAnnotationPopups: true });
// Example 2: hide popups for Redact, Circle and Square annotations:
var viewer = new GcPdfViewer("#root", { hideAnnotationPopups: ["Redact", "Circle", "Square"] });
```
- The save() method now allows specifying a range(s) of pages to save, changing page order or duplicating pages. (DOC-3916)
```javascript
// Example 1: save specified pages only:
await viewer.save("test.pdf", { pages: "0, 3, 5-7" });
// Example 2: duplicate and save the first page:
await viewer.save("test.pdf", { pages: "0, 0" });
// Example 3: split PDF into two documents:
await viewer.save("test_part1.pdf", { pages: "0-3" });
await viewer.save("test_part2.pdf", { pages: "4-8" });
// Example 4: change page order:
await viewer.save("test_changed_order.pdf", { pages: "3, 2, 1, 0" });
```
- The saveAsImages() method now allows specifying the zoom factor.
```javascript
// Example:
viewer.saveAsImages("sample.pdf", { zoomFactor: 1.5 });
```
### Fixed
- [Editor] In a PDF with different page sizes the 'move to next page' option may not work correctly. (DOC-5217)
- [Editor] A locked stamp annotation can still be edited in GcPdfViewer. (DOC-5216)
- [Editor] Cannot undo changes if the editor layout is not activated. (DOC-5315)
- [Editor] A popup annotation may move unexpectedly. (DOC-5318)
- Cannot navigate between pages using PageUp/PageDown keys in single page view. (DOC-5335)
- The list of layers is not shown correctly in some cases. (DOC-5338)
## [4.0.6] - 23-Mar-2023
### Fixed
- [Editor] Move to next page does not work correctly with different page sizes. (DOC-5217)
- [Editor] The zoom value changes after finishing a drawing with the OK button. (DOC-5184)
- [Regression] Form fields that should be hidden by a checkbox are still visible after unchecking the checkbox. (DOC-5242)
## [4.0.5] - 27-Feb-2023
### Fixed
- In some cases the signer's name is not shown correctly in the viewer. (DOC-5145)
- signatureValue returns incorrect JP text for certain PDFs. (DOC-5136)
- [Demos] Downloaded sample cannot be run correctly. (DOC-5149)
- [Editor] Annotations cannot be placed correctly in specific PDFs. (DOC-5125)
- [Editor] Ink annotations' position are incorrect when zooming in/out. (DOC-5139)
- [Editor] A checkbox is not checked when setting its fieldValue same as the export value. (DOC-5151)
- [Editor] Line coordinates are incorrect when adding a line annotation in a specific PDF. (DOC-5144)
- [Editor] A 'Drag and drop error' message shows when trying to input a property value in some cases. (DOC-5169)
- [Editor] In some scenarios, a checkbox that is checked by code does not show as checked. (DOC-5152)
- [Editor] A checkbox's shown value is not synchronized with its state. (DOC-5113)
- [Editor] For checkboxes with the same name, the checked state shows incorrectly by Acrobat in some cases. (DOC-5155)
## [4.0.4] - 06-Feb-2023
### Added
- [Demos] Added new sample "Prevent editing a signed PDF".
### Fixed
- Filling and saving a signed form invalidates the signature. (DOC-5090)
- Localization of digital signature verification. (DOC-5075)
## [4.0.3] - 20-Jan-2023
### Added
- [Editor] Added property editors for line annotation coordinates.
### Fixed
- [Editor] Modifying 'End Y‘ of a line coordinates causes the 'Start Y' to change. (DOC-5040)
- [Editor] In some cases the size of a checkbox becomes incorrect. (DOC-5042)
- Checkbox widgets with the same name did not work correctly. (DOC-4874)
- Ink highlight is not visible in the viewer. (DOC-5048)
- Cannot redefine Ctrl+P keyboard shortcut. (DOC-5021)
- UpdateAnnotation event is not triggered on switching radio buttons. (DOC-5020)
- When a Japanese text is assigned to a ButtonAppearance.Caption, the text is garbled in the generated PDF. (DOC-5028)
- Japanese texts are garbled in the article panel. (DOC-5038)
- PDF content can be printed using native browser menu even when Print is disabled by the disableFeatures option. (DOC-5035)
- disableFeatures.Print does not hide the Print context menu item. (DOC-5029)
- [Editor] Several issues with Ink, Polyline and Polygon annotations and callout lines. (DOC-5014)
- [Editor] Line annotation in the saved PDF is not shown in Acrobat. (DOC-5014)
- [iOS] Unable to toggle checkbox state on touch de