Upgrade Guide
Upgrading Dynamsoft Document Viewer from an old version to the latest version is straightforward. You need to pay attention to the following changes:
- Changes to Default
UIConfig - Changes to APIs
Changes to Default UIConfig
The default UI elements may be different across different versions. Check out this post to learn about the default configs.
You can try to unify the UI across versions by specifying the UIConfig. But pay attention to supported elements of different versions.
Changes to APIs
Breaking Changes in v5.0
v5.0 adopts a plugin design. You need to load plugins to make related features available.
The following is a list of affected APIs. Methods will throw errors, and properties and enumerations will be undefined if the required plugin is not installed.
Camera plugin:
Annotation plugin:
-
EditViewer:
-
Enumeration:
EnumAnnotationRenderMode’sloadAnnotationsoption (loadSource()andupdateSource()will throw an error if it is enabled but the plugin is not installed).EnumAnnotationRenderModeEnumStampIcon
-
Other:
DDV.getDefaultUiConfig()will ignore annotation-related elements.
Breaking Changes in v3.0
Initialization of Edit Viewer
In v2.x, you can use an additional options parameter to enable the annotation icon in the default UI.
const editViewer = new Dynamsoft.DDV.EditViewer({
container: "container",
uiConfig: Dynamsoft.DDV.getDefaultUiConfig("editViewer", {includeAnnotationSet: true}),
});
In v3.x, the option is removed and the annotation icon is included in the default UI. So you can just initialize it with the following code:
const editViewer = new Dynamsoft.DDV.EditViewer({
container: "container"
});
Getting the Page Data
Before v3.x, getPageData() returns a promise object, which was time consuming as it required getting all the image blobs. In v3.x, it directly returns an IPageData object and you can retrieve image blobs with its functions.