Skip to content

Commit 1bb4a3d

Browse files
Update upgrade guide to reflect changes in Code parser specification files and loadSpec() argument structure for v11.4.2000
1 parent e5dc3d7 commit 1bb4a3d

1 file changed

Lines changed: 23 additions & 1 deletion

File tree

  • programming/javascript/migrate-from-v10

programming/javascript/migrate-from-v10/index.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,29 @@ if (errorInfo.errorCode !== 0) {
101101

102102
#### Parser Resource Files Changed to .data Format
103103

104-
Code parser specification files have been consolidated from `.json` into encrypted `.data` files for improved security and simplified distribution. If you self-host these resources, update your file references:
104+
Starting from v11.4.2000, Code parser specification files have been consolidated into `.data` files, one per code type, for improved security and simplified distribution. This affects both the resource files themselves and the string passed to `loadSpec()`.
105+
106+
**`loadSpec()` argument update**: Sub-type strings are now merged into their parent type name. Old strings remain supported via a JavaScript-layer mapping, but updating to the new names is recommended:
107+
108+
| v10 `loadSpec()` call | v11 `loadSpec()` call |
109+
| --- | --- |
110+
| `loadSpec("MRTD_TD3_PASSPORT")` | `loadSpec("MRTD")` |
111+
| `loadSpec("MRTD_TD1_ID")` | `loadSpec("MRTD")` |
112+
| `loadSpec("MRTD_TD2_ID")` | `loadSpec("MRTD")` |
113+
| `loadSpec("AAMVA_DL_ID")` | `loadSpec("AAMVA_DL_ID")` |
114+
| `loadSpec("AAMVA_DL_ID_WITH_MAG_STRIPE")` | `loadSpec("AAMVA_DL_ID")` |
115+
116+
```javascript
117+
// before v11.4.2000
118+
Dynamsoft.DCP.CodeParserModule.loadSpec("MRTD_TD3_PASSPORT");
119+
Dynamsoft.DCP.CodeParserModule.loadSpec("MRTD_TD1_ID");
120+
Dynamsoft.DCP.CodeParserModule.loadSpec("MRTD_TD2_ID");
121+
122+
// now (recommended)
123+
Dynamsoft.DCP.CodeParserModule.loadSpec("MRTD");
124+
```
125+
126+
**Self-hosted resource files**: If you host these files yourself, replace the old `.data` & `_Map.text` files with the new `.data` equivalents:
105127

106128
| Old File | New File |
107129
| --- | --- |

0 commit comments

Comments
 (0)