|
| 1 | +--- |
| 2 | +layout: default-layout |
| 3 | +needAutoGenerateSidebar: true |
| 4 | +title: Dynamic Web TWAIN Development - Upgrade Guide |
| 5 | +keywords: Dynamic Web TWAIN, Documentation, Development, Upgrade Guide |
| 6 | +breadcrumbText: Upgrade Guide |
| 7 | +description: Dynamic Web TWAIN SDK Documentation Upgrade Guide Page |
| 8 | +--- |
| 9 | + |
| 10 | +# Upgrade |
| 11 | + |
| 12 | +This upgrade section talks about how to upgrade Dynamic Web TWAIN to the latest version. |
| 13 | + |
| 14 | +#### IMPORTANT |
| 15 | + |
| 16 | +Please be aware of the following namespace changes introduced in version 17.0. |
| 17 | + |
| 18 | +| v17.0+ |v16.2- | |
| 19 | +|:-|:-| |
| 20 | +|`Dynamsoft.DWT` |`Dynamsoft.WebTwainEnv`| |
| 21 | +|`Dynamsoft.DWT.EnumDWT_` |`Dynamsoft.EnumDWT_`| |
| 22 | +|`Dynamsoft.DBR.EnumBarcodeFormat` |`Dynamsoft.EnumBarcodeFormat`| |
| 23 | + |
| 24 | +More barcode enumeration can be found <a href="https://www.dynamsoft.com/barcode-reader/programming/javascript/api-reference/enum/EnumBarcodeColourMode.html?ver=latest" target="_blank">here</a> |
| 25 | + |
| 26 | +Please review our <a href="{{site.info}}schedule/stable.html" target="_blank">changelog</a> for all breaking changes. |
| 27 | + |
| 28 | +Please refer to <a href="{{site.info}}schedule/deprecated.html" target="_blank">this list</a> for all deprecated features. |
| 29 | + |
| 30 | +## Update the resources files |
| 31 | + |
| 32 | +The resources files refer to the Resources folder in the installation directory, C:\Program Files (x86)\Dynamsoft\Dynamic Web TWAIN SDK 17.0. For more details, you can check <a href="{{site.indepth}}faqs/general/what-are-the-resources-files.html" target="_blank">here</a> |
| 33 | + |
| 34 | +### Regular Web application |
| 35 | + |
| 36 | +#### Uninstall the old version |
| 37 | + |
| 38 | +* **Windows**: Search `Dynamic Web TWAIN` in `Control Panel -> Programs and Features` , and remove all the relevant components there. |
| 39 | + |
| 40 | +* **macOS**: Execute `Applications > Dynamsoft > Dynamic Web TWAIN SDK {Version Number} > Uninstall.pkg` |
| 41 | + |
| 42 | +#### Install the new version |
| 43 | + |
| 44 | +You can use the <a href="{{site.about}}resources.html#how-to-get-dwt" target="_blank"> official installer</a> to install the new verion. |
| 45 | + |
| 46 | +<a href="https://www.dynamsoft.com/web-twain/downloads" class="downloadBtn fr textUpperCase">Download SDK</a> |
| 47 | + |
| 48 | +#### Replace the resources files |
| 49 | + |
| 50 | +If you haven't renamed the official folder, the resources files should reside in a folder named "Resources". In this step, copy the new resources files and replace the old ones. The new files are typically found in the following location after the installation |
| 51 | + |
| 52 | +* **Windows**: `C:\Program Files (x86)\Dynamsoft\Dynamic Web TWAIN SDK {Version Number}\` |
| 53 | +* **macOS**: `Applications > Dynamsoft > Dynamic Web TWAIN SDK {Version Number}` |
| 54 | + |
| 55 | +### Applications that make use of the `dwt` package |
| 56 | + |
| 57 | +If your application uses a framework or library like `Angular` , `React` , `Vue` , etc., the upgrade is easier as you just need to install the new version to replace the old one. For example |
| 58 | + |
| 59 | +``` cmd |
| 60 | +npm install dwt |
| 61 | +``` |
| 62 | + |
| 63 | +or |
| 64 | + |
| 65 | +``` cmd |
| 66 | +yarn add dwt |
| 67 | +``` |
| 68 | + |
| 69 | +You may want to update the types definition as well |
| 70 | + |
| 71 | +``` cmd |
| 72 | +npm install @types/dwt |
| 73 | +``` |
| 74 | + |
| 75 | +or |
| 76 | + |
| 77 | +``` cmd |
| 78 | +yarn add @types/dwt |
| 79 | +``` |
| 80 | + |
| 81 | +## Update the Product Key |
| 82 | + |
| 83 | +The Product Key needs to be updated when your current license is no longer valid (expired, for example) or when you upgrade across major versions. The Product Key is set using the global API `Dynamsoft.DWT.ProductKey` and the change is only effective before <a href="{{site.indepth}}features/initialize.html#creating-the-webtwain-instance" target="_blank">creating `WebTwain` instances</a> |
| 84 | + |
| 85 | +In most cases, you can just make the change in the file `dynamsoft.webtwain.config.js` . |
| 86 | + |
| 87 | +``` javascript |
| 88 | +// If you have multiple license keys, just separate them with semicolons. |
| 89 | +Dynamsoft.DWT.ProductKey = 't0076lQAAAGNcO61He******;t0076lQAAAGNcO61He******'; |
| 90 | +``` |
| 91 | + |
| 92 | +If it is set elsewhere, you need to find it and replace it. For example, if you are making use of the [dwt package](https://www.npmjs.com/package/dwt) (`dynamsoft.webtwain.min.js` or `dynamsoft.webtwain.min.mjs`), the file `dynamsoft.webtwain.config.js` doesn't exist and you should already have the above line of code in your own JavaScript where you can update the license when needed. |
| 93 | + |
| 94 | +But if you are using <a href="https://www.dynamsoft.com/Products/WebTWAIN_License.aspx#per_browser_client" target="_blank">Per Client Device License </a>, you need to use <a href="{{site.info}}api/Dynamsoft_WebTwainEnv.html#organizationid" target="_blank">organizationID</a> |
| 95 | + |
| 96 | +``` javascript |
| 97 | +Dynamsoft.DWT.organizationID = "123456"; // replace the number 123456 with YOUR-ORGANIZATION-ID. |
| 98 | +//Note: organizationID and ProductKey cannot be used together |
| 99 | +``` |
| 100 | + |
| 101 | +Please note that this licensing model is only supported from `DWT` 17.0 and needs to be used with Dynamsoft License Server (`DLS` for short). See more about <a href="https://www.dynamsoft.com/license-server/docs/about/terms.html?ver=latest#dynamsoft-license-server" target="_blank">What is a DLS</a> |
| 102 | + |
| 103 | +## Update `Dynamsoft Service` on the client-side |
| 104 | + |
| 105 | +### Service mode |
| 106 | + |
| 107 | + Starting in version 16.*, `Dynamsoft Service` is designed to be backward compatible (unfortunately, just as far back as 16.0). The compatibility is done in two ways |
| 108 | + |
| 109 | +* For minor versions like 16.1 to 16.2, if the newer version of `Dynamsoft Service` has been installed on a desktop, websites utilizing both the newer version and the older version can work without reinstallation of `Dynamsoft Service` |
| 110 | +* For major versions like 16.* to 17.*, the newer version will be installed to a different directory which can coexist with the service directory of the old version. The user can choose to uninstall the old version if necessary |
| 111 | + |
| 112 | +That means, once you, as the maintainer, have finished upgrading your application to a newer `Dynamic Web TWAIN` on the server side, the clients could face one of two situations |
| 113 | + |
| 114 | +* If the clients have installed the same or even newer minor version of `Dynamsoft Service` themselves (probably from another application that uses `Dynamic Web TWAIN` ), they don't need to do anything; |
| 115 | +* If the clients never installed `Dynamsoft Service` or have an older version or a different new major version of it, they will be required to do a reinstallation of `Dynamsoft Service`. The process is described <a href="{{site.indepth}}deployment/service.html#how-to-install-dwt" target="_blank">here</a> |
| 116 | + |
| 117 | +### WASM mode |
| 118 | + |
| 119 | +By comparison, if `Dynamic Web TWAIN` runs only in the <a href="{{site.indepth}}features/initialize.html#wasm-mode" target="_blank">WASM mode</a>, the clients don't need to install anything themselves as the <a href="{{site.getstarted}}platform.html#wasm-browsers" target="_blank">WASM browsers</a> will take care of the upgrade process. What the clients may encounter is a slower-than-usual page load when they visit the application for the first time after the upgrade. |
| 120 | + |
| 121 | +Once upgraded, the old WASM files will continue to exist in the browser as cached data until it's purged by the browser or by the user. |
| 122 | + |
| 123 | +## Other Topics |
| 124 | + |
| 125 | +### Expand your application to mobile platforms |
| 126 | + |
| 127 | +If you are upgrading to version 17 for mobile functionality (basically, `DWT` in <a href="{{site.indepth}}features/initialize.html#wasm-mode" target="_blank">WASM mode</a>, there are some considerations to be made. As mobile support is one of the newest offerings from Dynamsoft, not all of the old `DWT` features are fully available at present. That said, we are constantly working on increasing the supported mobile feature set, so we recommend reviewing our <a href="{{site.info}}schedule/stable.html" target="_blank">release notes</a>, and if you have any questions, contact <a href="{{site.about}}getsupport.html" target="_blank">Dynamsoft Support</a> |
| 128 | + |
| 129 | +As an example for how some existing `DWT` features will work on <a href="{{site.getstarted}}platform.html#browsers-on-mobile-devices" target="_blank">mobile platforms</a> |
| 130 | + |
| 131 | +#### Scanning |
| 132 | + |
| 133 | +This will become either capturing from mobile cameras or <a href="{{site.indepth}}features/input.html#how-to-enable-remote-scan" target="_blank">capturing from a Remote Windows machine</a> in the LAN. |
| 134 | + |
| 135 | +#### Loading |
| 136 | + |
| 137 | +This will be either loading or capturing. |
| 138 | + |
| 139 | +#### Saving |
| 140 | + |
| 141 | +This will become an in-browser download operation as mentioned <a href="{{site.indepth}}features/output.html#save-as-a-download" target="_blank">here</a> |
| 142 | + |
| 143 | +#### Editing |
| 144 | + |
| 145 | +Similar to existing desktop functionality but the performance is not as good. |
| 146 | + |
| 147 | +#### Uploading |
| 148 | + |
| 149 | +Similar to existing desktop browser functionality but is limited to only one API <a href="{{site.info}}api/WebTwain_IO.html#httpupload" target="_blank">`HTTPUpload()`</a> |
| 150 | + |
| 151 | +#### Viewing |
| 152 | + |
| 153 | +Identical to current desktop browser functionality. |
| 154 | + |
| 155 | +#### Barcode reading |
| 156 | + |
| 157 | +Identical to current desktop browser functionality. |
| 158 | + |
| 159 | +#### PDF Handling |
| 160 | + |
| 161 | +Similar to current desktop browser functionality but the rasterizing feature depends on embeded fonts in the PDF file whereas the on desktop, the system fonts can also be used. |
| 162 | + |
| 163 | +#### OCR |
| 164 | + |
| 165 | +Client-side support is to be added in a later version. |
0 commit comments