|
| 1 | +--- |
| 2 | +layout: default-layout |
| 3 | +needAutoGenerateSidebar: true |
| 4 | +needGenerateH3Content: true |
| 5 | +noTitleIndex: true |
| 6 | +title: Upgrade Guide Dynamsoft Document Viewer Documentation |
| 7 | +keywords: Documentation, Dynamsoft Document Viewer, Upgrade |
| 8 | +breadcrumbText: Upgrade Guide |
| 9 | +description: Upgrade guide for Dynamsoft Document Viewer |
| 10 | +--- |
| 11 | + |
| 12 | +# Upgrade Guide |
| 13 | + |
| 14 | +Upgrading Dynamsoft Document Viewer from an old version to the latest version (v3.x as of now) is straightforward. You need to pay attention to the following changes: |
| 15 | + |
| 16 | +* Changes of APIs |
| 17 | +* Changes of [`UIConfig`](/api/interface/uiconfig.md) |
| 18 | + |
| 19 | + |
| 20 | +There are some code snippets that are frequently used and we will talk about the changes you have to make. |
| 21 | + |
| 22 | +## Initialization of Edit Viewer |
| 23 | + |
| 24 | +In v2.x, you can use an additional options parameter to enable the annotation icon in the default UI. |
| 25 | + |
| 26 | +```js |
| 27 | +const editViewer = new Dynamsoft.DDV.EditViewer({ |
| 28 | + container: "container", |
| 29 | + uiConfig: Dynamsoft.DDV.getDefaultUiConfig("editViewer", {includeAnnotationSet: true}), |
| 30 | +}); |
| 31 | +``` |
| 32 | + |
| 33 | +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: |
| 34 | + |
| 35 | +```js |
| 36 | +const editViewer = new Dynamsoft.DDV.EditViewer({ |
| 37 | + container: "container" |
| 38 | +}); |
| 39 | +``` |
| 40 | + |
| 41 | +## Default UI Config |
| 42 | + |
| 43 | +The default UI elements may be different across different versions. Check out [this post](/ui/default_ui.md) to learn about the default configs. |
| 44 | + |
| 45 | +You can try to unify the UI across versions by specifying the [`UIConfig`](/api/interface/uiconfig.md). But pay attention to supported [elements](/ui/default_elements.md) of different versions. |
| 46 | + |
| 47 | +## Getting the Page Data |
| 48 | + |
| 49 | +Before v3.x, [`getPageData()`](/api/interface/idocument/index.md#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`](/api/interface/ipagedata.md) object and you can retrieve image blobs with its functions. |
0 commit comments