dwt 16.2.4 → 16.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +16 -12
  2. package/dist/addon/dbrjs/dbr-7.6.0.full.wasm.js +4016 -4016
  3. package/dist/addon/dbrjs/dbr-7.6.0.worker.js +107 -107
  4. package/dist/addon/dbrjs/dbr.js +10 -10
  5. package/dist/dist/DynamsoftServiceSetup.deb +0 -0
  6. package/dist/dist/DynamsoftServiceSetup.msi +0 -0
  7. package/dist/dist/DynamsoftServiceSetup.pkg +0 -0
  8. package/dist/dist/DynamsoftServiceSetup.rpm +0 -0
  9. package/dist/dist/LICENSE +95 -95
  10. package/dist/dynamsoft.webtwain.min.js +209 -209
  11. package/dist/dynamsoft.webtwain.min.mjs +208 -208
  12. package/dist/src/dynamsoft.imageio_wasm-1.6.2.js +93 -93
  13. package/dist/src/dynamsoft.webtwain.css +1045 -1045
  14. package/dist/types/Addon.BarcodeReader.d.ts +168 -168
  15. package/dist/types/Addon.Camera.d.ts +125 -125
  16. package/dist/types/Addon.OCR.d.ts +264 -264
  17. package/dist/types/Addon.OCRPro.d.ts +251 -251
  18. package/dist/types/Addon.PDF.d.ts +110 -110
  19. package/dist/types/Addon.Webcam.d.ts +257 -257
  20. package/dist/types/Dynamsoft.Enum.d.ts +1850 -1849
  21. package/dist/types/Dynamsoft.FileUploader.d.ts +130 -130
  22. package/dist/types/Dynamsoft.d.ts +495 -495
  23. package/dist/types/WebTwain.Acquire.d.ts +1059 -1059
  24. package/dist/types/WebTwain.Buffer.d.ts +259 -259
  25. package/dist/types/WebTwain.Edit.d.ts +434 -434
  26. package/dist/types/WebTwain.IO.d.ts +951 -951
  27. package/dist/types/WebTwain.Util.d.ts +102 -102
  28. package/dist/types/WebTwain.Viewer.d.ts +795 -795
  29. package/dist/types/WebTwain.d.ts +51 -51
  30. package/dist/types/index.d.ts +20 -20
  31. package/package.json +2 -2
  32. package/samples/1.AcquireImage.html +0 -69
  33. package/samples/2.CustomScan.html +0 -98
  34. package/samples/3.PDFRasterizer.html +0 -73
  35. package/samples/4.OCRADocument.html +0 -156
  36. package/samples/5.ReadBarcode.html +0 -231
  37. package/samples/6.ScanOrCapture.html +0 -189
@@ -1,51 +1,51 @@
1
- import { DynamsoftEnums as Dynamsoft } from "./Dynamsoft.Enum";
2
- import { WebTwainViewer } from "./WebTwain.Viewer";
3
- import { BarcodeReader } from "./Addon.BarcodeReader";
4
- import { OCR } from "./Addon.OCR";
5
- import { OCRPro } from "./Addon.OCRPro";
6
- import { PDF } from "./Addon.PDF";
7
- import { Webcam } from "./Addon.Webcam";
8
- import { Camera } from "./Addon.Camera";
9
-
10
- export interface WebTwain extends WebTwainViewer {
11
- /**
12
- * Addons to WebTwain instances.
13
- */
14
- Addon: Addon;
15
- /**
16
- * [Deprecation] This API is no longer needed.
17
- */
18
- AllowMultiSelect: boolean;
19
- /**
20
- * [Deprecation] This API is no longer needed.
21
- */
22
- AllowPluginAuthentication: boolean;
23
- /**
24
- * [Deprecation] This API is no longer needed.
25
- */
26
- AsyncMode: boolean;
27
- /**
28
- * [Deprecation] This API is no longer needed.
29
- */
30
- BorderStyle: Dynamsoft.EnumDWT_BorderStyle | number;
31
- /**
32
- * Return whether a WebTwain instance is ready to use.
33
- */
34
- readonly bReady: boolean;
35
- /**
36
- * [Deprecation] This API is no longer needed.
37
- */
38
- BrokerProcessType: number;
39
- /**
40
- * [Deprecation] This API is no longer needed.
41
- */
42
- EnableInteractiveZoom: boolean;
43
- }
44
- export interface Addon {
45
- BarcodeReader: BarcodeReader;
46
- OCR: OCR;
47
- OCRPro: OCRPro;
48
- PDF: PDF;
49
- Webcam: Webcam;
50
- Camera: Camera;
51
- }
1
+ import { DynamsoftEnums as Dynamsoft } from "./Dynamsoft.Enum";
2
+ import { WebTwainViewer } from "./WebTwain.Viewer";
3
+ import { BarcodeReader } from "./Addon.BarcodeReader";
4
+ import { OCR } from "./Addon.OCR";
5
+ import { OCRPro } from "./Addon.OCRPro";
6
+ import { PDF } from "./Addon.PDF";
7
+ import { Webcam } from "./Addon.Webcam";
8
+ import { Camera } from "./Addon.Camera";
9
+
10
+ export interface WebTwain extends WebTwainViewer {
11
+ /**
12
+ * Addons to WebTwain instances.
13
+ */
14
+ Addon: Addon;
15
+ /**
16
+ * [Deprecation] This API is no longer needed.
17
+ */
18
+ AllowMultiSelect: boolean;
19
+ /**
20
+ * [Deprecation] This API is no longer needed.
21
+ */
22
+ AllowPluginAuthentication: boolean;
23
+ /**
24
+ * [Deprecation] This API is no longer needed.
25
+ */
26
+ AsyncMode: boolean;
27
+ /**
28
+ * [Deprecation] This API is no longer needed.
29
+ */
30
+ BorderStyle: Dynamsoft.EnumDWT_BorderStyle | number;
31
+ /**
32
+ * Return whether a WebTwain instance is ready to use.
33
+ */
34
+ readonly bReady: boolean;
35
+ /**
36
+ * [Deprecation] This API is no longer needed.
37
+ */
38
+ BrokerProcessType: number;
39
+ /**
40
+ * [Deprecation] This API is no longer needed.
41
+ */
42
+ EnableInteractiveZoom: boolean;
43
+ }
44
+ export interface Addon {
45
+ BarcodeReader: BarcodeReader;
46
+ OCR: OCR;
47
+ OCRPro: OCRPro;
48
+ PDF: PDF;
49
+ Webcam: Webcam;
50
+ Camera: Camera;
51
+ }
@@ -1,20 +1,20 @@
1
- // Type definitions for dwt 16.2
2
- // Project: https://www.dynamsoft.com/products/webtwain_overview.aspx
3
- // Definitions by: Xiao Ling <https://github.com/yushulx>
4
- // Josh Hall <https://github.com/jbh>
5
- // Lincoln Hu <https://github.com/lincoln2018>
6
- // Tom Kent <https://github.com/Tom-Dynamsoft>
7
- // Dave Sueltenfuss <https://github.com/dsueltenfuss>
8
- // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9
- // TypeScript Version: 3.1
10
-
11
- /*!
12
- * Product: Dynamsoft Web Twain
13
- * Web Site: http://www.dynamsoft.com
14
- *
15
- * Copyright 2021, Dynamsoft Corporation
16
- * Author: Dynamsoft Support Team
17
- * Version: 16.2
18
- */
19
- import Dynamsoft from "./Dynamsoft";
20
- export default Dynamsoft;
1
+ // Type definitions for dwt 16.2
2
+ // Project: https://www.dynamsoft.com/products/webtwain_overview.aspx
3
+ // Definitions by: Xiao Ling <https://github.com/yushulx>
4
+ // Josh Hall <https://github.com/jbh>
5
+ // Lincoln Hu <https://github.com/lincoln2018>
6
+ // Tom Kent <https://github.com/Tom-Dynamsoft>
7
+ // Dave Sueltenfuss <https://github.com/dsueltenfuss>
8
+ // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
9
+ // TypeScript Version: 3.1
10
+
11
+ /*!
12
+ * Product: Dynamsoft Web Twain
13
+ * Web Site: http://www.dynamsoft.com
14
+ *
15
+ * Copyright 2021, Dynamsoft Corporation
16
+ * Author: Dynamsoft Support Team
17
+ * Version: 16.2.6
18
+ */
19
+ import Dynamsoft from "./Dynamsoft";
20
+ export default Dynamsoft;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dwt",
3
- "version": "16.2.4",
3
+ "version": "16.2.6",
4
4
  "author": {
5
5
  "name": "Dynamsoft",
6
6
  "url": "https://www.dynamsoft.com"
@@ -16,7 +16,7 @@
16
16
  "dist",
17
17
  "samples"
18
18
  ],
19
- "homepage": "https://www.dynamsoft.com/Products/WebTWAIN_Overview.aspx",
19
+ "homepage": "https://www.dynamsoft.com/web-twain/overview/",
20
20
  "keywords": [
21
21
  "TWAIN",
22
22
  "JavaScript",
@@ -1,69 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <title>Use Auto Feeder to scan</title>
6
- <script src="../dist/dynamsoft.webtwain.min.js"></script>
7
- </head>
8
-
9
- <body style="padding: 30px;">
10
- <lable id="ADF" style="font-size: x-large;" ><input type="checkbox" checked="checked">Auto Feeder</lable>
11
- <input type="button" style="font-size: x-large;" id="acquireButton" value="Acquire" onclick="AcquireImage();" />
12
- <input type="button" style="font-size: x-large;display:none;" id="mobileFile" value="Acquire" onclick="LoadImage()" />
13
- <!-- dwtcontrolContainer is the default div id for Dynamic Web TWAIN control.
14
- If you need to rename the id, you should also change the id in the dynamsoft.webtwain.config.js accordingly. -->
15
- <br />
16
- <br />
17
- <div id="dwtcontrolContainer"></div>
18
-
19
- <script type="text/javascript">
20
- Dynamsoft.WebTwainEnv.ResourcesPath = "../dist";
21
- Dynamsoft.WebTwainEnv.ProductKey = 't00911wAAADwPAaIxHA38XfQgvv+o7wY1qFx4aAL6m5W9nK9ulevyXbe4DIRCPw4FUKWxOQpvvGnefCmnCtBu/1TALNmgEBeWrEAOcP/Asw44TCBWNwip6r+8VPorfA==';
22
- Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
23
- window.onload = function () {
24
- if (Dynamsoft.Lib.env.bMobile) {
25
- document.getElementById('ADF').style.display = "none";
26
- document.getElementById('acquireButton').style.display = "none";
27
- document.getElementById('mobileFile').style.display = "";
28
- }
29
- Dynamsoft.WebTwainEnv.Containers = [{ContainerId:'dwtcontrolContainer', Width:600, Height:800}];
30
- Dynamsoft.WebTwainEnv.Load();
31
- };
32
- var DWObject;
33
-
34
- function Dynamsoft_OnReady() {
35
- DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
36
- }
37
-
38
- function AcquireImage() {
39
- if (DWObject) {
40
- DWObject.SelectSource(function () {
41
- DWObject.OpenSource();
42
- DWObject.AcquireImage(
43
- {
44
- IfShowUI: false,
45
- IfFeederEnabled: document.getElementById("ADF").checked,
46
- PixelType: Dynamsoft.EnumDWT_PixelType.TWPT_RGB,
47
- Resolution: 200,
48
- IfDisableSourceAfterAcquire: true
49
- },
50
- function () {
51
- console.log("Successful!");
52
- },
53
- function (settings, errCode, errString) {
54
- alert(errString)
55
- }
56
- );
57
- }, function () {
58
- alert('SelectSource failed!');
59
- });
60
- }
61
- }
62
-
63
- function LoadImage() {
64
- DWObject.LoadImageEx('', 5);
65
- }
66
- </script>
67
- </body>
68
-
69
- </html>
@@ -1,98 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <title>Custom Scan</title>
6
- <script src="../dist/dynamsoft.webtwain.min.js"></script>
7
- </head>
8
-
9
- <body style="padding: 30px;">
10
- <div id="scanOptions">
11
- <label for="BW" >
12
- <input type="radio" value="0" name="PixelType">B&amp;W </label>
13
- <label for="Gray">
14
- <input type="radio" value="1" name="PixelType">Gray</label>
15
- <label for="RGB">
16
- <input type="radio" value="2" name="PixelType" checked="checked">Color</label>
17
- |
18
-
19
- <label>
20
- <input type="checkbox" id="ADF" checked="checked">Auto Feeder</label>
21
- <label>
22
- <input type="checkbox" id="ShowUI" checked="checked">Show UI
23
- <br />
24
- </label>
25
-
26
- <select id="Resolution">
27
- <option value="100">100</option>
28
- <option value="150">150</option>
29
- <option value="200">200</option>
30
- <option value="300">300</option>
31
- </select>
32
- <select id="source" style="position: relative; width: 220px;"></select>
33
-
34
- <input type="button" value="Scan" onclick="AcquireImage();" />
35
- </div>
36
- <input type="button" id="mobileFile" value="Acquire" style="font-size: x-large;display:none" onclick="LoadImage()" />
37
- <br />
38
- <div id="dwtcontrolContainer"></div>
39
- <script type="text/javascript">
40
- Dynamsoft.WebTwainEnv.ResourcesPath = "../dist";
41
- Dynamsoft.WebTwainEnv.ProductKey = 't00911wAAADwPAaIxHA38XfQgvv+o7wY1qFx4aAL6m5W9nK9ulevyXbe4DIRCPw4FUKWxOQpvvGnefCmnCtBu/1TALNmgEBeWrEAOcP/Asw44TCBWNwip6r+8VPorfA==';
42
- Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady); // Register OnWebTwainReady event. This event fires as soon as Dynamic Web TWAIN is initialized and ready to be used
43
- window.onload = function () {
44
- if (Dynamsoft.Lib.env.bMobile) {
45
- document.getElementById('scanOptions').style.display = "none";
46
- document.getElementById('mobileFile').style.display = "";
47
- }
48
- Dynamsoft.WebTwainEnv.Containers = [{ContainerId:'dwtcontrolContainer', Width:600, Height:800}];
49
- Dynamsoft.WebTwainEnv.Load();
50
- };
51
- var DWObject;
52
-
53
- function Dynamsoft_OnReady() {
54
- DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); // Get the Dynamic Web TWAIN object that is embeded in the div with id 'dwtcontrolContainer'
55
- if (DWObject) {
56
- var count = DWObject.SourceCount;
57
- for (var i = 0; i < count; i++)
58
- document.getElementById("source").options.add(new Option(DWObject.GetSourceNameItems(i), i));
59
- }
60
- }
61
-
62
- function AcquireImage() {
63
- if (DWObject) {
64
- DWObject.SelectSourceByIndex(document.getElementById("source").selectedIndex);
65
- DWObject.OpenSource();
66
- var pixelType = 2;
67
- var pixelTypeInputs = document.getElementsByName("PixelType");
68
- for (var i = 0; i < pixelTypeInputs.length; i++) {
69
- if (pixelTypeInputs[i].checked) {
70
- pixelType = pixelTypeInputs[i].value;
71
- break;
72
- }
73
- }
74
- DWObject.AcquireImage(
75
- {
76
- IfShowUI: document.getElementById("ShowUI").checked,
77
- IfFeederEnabled: document.getElementById("ADF").checked,
78
- PixelType: pixelType,
79
- Resolution: parseInt(document.getElementById("Resolution").value),
80
- IfDisableSourceAfterAcquire: true
81
- },
82
- function () {
83
- console.log("Successful!");
84
- },
85
- function (settings, errCode, errString) {
86
- alert(errString)
87
- }
88
- );
89
- }
90
- }
91
-
92
- function LoadImage() {
93
- DWObject.LoadImageEx('', 5);
94
- }
95
- </script>
96
- </body>
97
-
98
- </html>
@@ -1,73 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <title>Rasterize a PDF</title>
6
- <script src="../dist/dynamsoft.webtwain.min.js"></script>
7
- </head>
8
-
9
- <body style="padding: 30px;">
10
- <input type="button" style="font-size: x-large;" id="acquireButton" value="Acquire" onclick="AcquireImage();" />
11
- <input type="button" style="font-size: x-large;" id="loadButton" value="Load PDFs" onclick="LoadImages();" />
12
- <br />
13
- <br />
14
- <div id="dwtcontrolContainer"></div>
15
- <script type="text/javascript">
16
- Dynamsoft.WebTwainEnv.ResourcesPath = "../dist";
17
- Dynamsoft.WebTwainEnv.ProductKey = 't00911wAAADwPAaIxHA38XfQgvv+o7wY1qFx4aAL6m5W9nK9ulevyXbe4DIRCPw4FUKWxOQpvvGnefCmnCtBu/1TALNmgEBeWrEAOcP/Asw44TCBWNwip6r+8VPorfA==';
18
- Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
19
- window.onload = function () {
20
- if (Dynamsoft.Lib.env.bMobile) {
21
- document.getElementById('acquireButton').style.display = "none";
22
- }
23
- Dynamsoft.WebTwainEnv.Containers = [{ContainerId:'dwtcontrolContainer', Width:600, Height:800}];
24
- Dynamsoft.WebTwainEnv.Load();
25
- };
26
- var DWObject;
27
-
28
- function Dynamsoft_OnReady() {
29
- DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer');
30
- }
31
-
32
- function AcquireImage() {
33
- if (DWObject) {
34
- DWObject.SelectSource(function () {
35
- DWObject.OpenSource();
36
- DWObject.AcquireImage(
37
- {
38
- IfShowUI: false,
39
- PixelType: Dynamsoft.EnumDWT_PixelType.TWPT_RGB,
40
- Resolution: 200,
41
- IfDisableSourceAfterAcquire: true
42
- },
43
- function () {
44
- console.log("Successful!");
45
- },
46
- function (settings, errCode, errString) {
47
- alert(errString)
48
- }
49
- );
50
- }, function () {
51
- alert('SelectSource failed!');
52
- });
53
- }
54
- }
55
-
56
- function LoadImages() {
57
- if (DWObject) {
58
- if (DWObject.Addon && DWObject.Addon.PDF) {
59
- DWObject.Addon.PDF.SetResolution(300);
60
- DWObject.Addon.PDF.SetConvertMode(EnumDWT_ConvertMode.CM_RENDERALL);
61
- }
62
- DWObject.LoadImageEx('', 4,
63
- function () { },
64
- function (errorCode, errorString) {
65
- alert('Load Image:' + errorString);
66
- }
67
- );
68
- }
69
- }
70
- </script>
71
- </body>
72
-
73
- </html>
@@ -1,156 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
-
4
- <head>
5
- <title>OCR scanned or loaded documents</title>
6
- <script src="../dist/dynamsoft.webtwain.min.js"></script>
7
- </head>
8
-
9
- <body style="padding: 30px;">
10
- <div id="notMobile">
11
- <h1>Scan or Load documents and OCR them (English as an example)</h1>
12
- <h4>Other languages are also supported, contact support@dynamsoft.com for more info.</h4>
13
- <p>Note: To avoid CORS errors, please deploy this sample to a HTTP server to try.</p>
14
- <br />
15
- <input type="button" value="Scan Documents" onclick="AcquireImage();" />
16
- <input type="button" value="Load Images or PDFs" onclick="LoadImages();" style="margin-right: 20px;" />
17
- <input type="button" value="OCR An Image in English" onclick="DoOCR();" />
18
- <br />
19
- <br />
20
- <div id="dwtcontrolContainer" style="float:left;"></div>
21
- <div id="divNoteMessage" ondblclick="this.innerHTML='';"
22
- style="margin:0px 20px; float:left;width:300px; height:350px; overflow: auto;background-color:#e7f2fd;border:solid 1px black;">
23
- </div>
24
-
25
- <br />
26
- </div>
27
- <h1 id="mobile" style="margin:10vmin; display: none;">
28
- The OCR Add-on is coming to the mobile platform in a later version, stay tuned!!
29
- </h1>
30
- <script type="text/javascript">
31
- Dynamsoft.WebTwainEnv.ResourcesPath = "../dist";
32
- Dynamsoft.WebTwainEnv.ProductKey = 't00911wAAADwPAaIxHA38XfQgvv+o7wY1qFx4aAL6m5W9nK9ulevyXbe4DIRCPw4FUKWxOQpvvGnefCmnCtBu/1TALNmgEBeWrEAOcP/Asw44TCBWNwip6r+8VPorfA==';
33
- Dynamsoft.WebTwainEnv.RegisterEvent('OnWebTwainReady', Dynamsoft_OnReady);
34
- window.onload = function () {
35
- if (Dynamsoft && Dynamsoft.Lib.env.bWin && Dynamsoft.Lib.product.bHTML5Edition && Dynamsoft.WebTwainEnv.UseLocalService) {
36
- Dynamsoft.WebTwainEnv.Load();
37
- }
38
- else {
39
- if (Dynamsoft.Lib.env.bMobile) {
40
- document.getElementById('notMobile').style.display = "none";
41
- document.getElementById('mobile').style.display = "";
42
- } else
43
- alert("The OCR add-on doesn't work on your browser or in the WASM mode, please use modern browsers like Chrome, Firefox in the Service mode.");
44
- }
45
- };
46
- var DWObject;
47
-
48
- function Dynamsoft_OnReady() {
49
- DWObject = Dynamsoft.WebTwainEnv.GetWebTwain('dwtcontrolContainer'); // Get the Dynamic Web TWAIN object that is embeded in the div with id 'dwtcontrolContainer'
50
- if (DWObject) {
51
- downloadOCRBasic(true);
52
- }
53
- }
54
-
55
- function downloadOCRBasic(bDownloadDLL) {
56
- var strOCRPath = Dynamsoft.WebTwainEnv.ResourcesPath + "/addon/OCRx64.zip",
57
- strOCRLangPath = Dynamsoft.WebTwainEnv.ResourcesPath + '/addon/OCRBasicLanguages/English.zip';
58
-
59
- if (bDownloadDLL) {
60
- if (DWObject.Addon.OCR.IsModuleInstalled()) {
61
- /*console.log('OCR dll is installed');*/
62
- downloadOCRBasic(false);
63
- } else {
64
- DWObject.Addon.OCR.Download(
65
- strOCRPath,
66
- function () { /*console.log('OCR dll is installed');*/
67
- downloadOCRBasic(false);
68
- },
69
- function (errorCode, errorString) {
70
- console.log(errorString);
71
- }
72
- );
73
- }
74
- } else {
75
- DWObject.Addon.OCR.DownloadLangData(
76
- strOCRLangPath,
77
- function () { },
78
- function (errorCode, errorString) {
79
- console.log(errorString);
80
- });
81
- }
82
- }
83
-
84
- function AcquireImage() {
85
- if (DWObject) {
86
- DWObject.SelectSource(function () {
87
- DWObject.OpenSource();
88
- DWObject.AcquireImage(
89
- {
90
- IfShowUI: false,
91
- PixelType: Dynamsoft.EnumDWT_PixelType.TWPT_RGB,
92
- Resolution: 200,
93
- IfDisableSourceAfterAcquire: true
94
- },
95
- function () {
96
- console.log("Successful!");
97
- },
98
- function (settings, errCode, errString) {
99
- alert(errString)
100
- }
101
- );
102
- }, function () {
103
- alert('SelectSource failed!');
104
- });
105
- }
106
- }
107
-
108
- function LoadImages() {
109
- if (DWObject) {
110
- if (DWObject.Addon && DWObject.Addon.PDF) {
111
- DWObject.Addon.PDF.SetResolution(300);
112
- DWObject.Addon.PDF.SetConvertMode(EnumDWT_ConvertMode.CM_RENDERALL);
113
- }
114
- DWObject.LoadImageEx('', 5,
115
- function () { },
116
- function (errorCode, errorString) {
117
- alert('Load Image:' + errorString);
118
- }
119
- );
120
- }
121
- }
122
-
123
- function DoOCR() {
124
- if (DWObject) {
125
- if (DWObject.HowManyImagesInBuffer == 0) {
126
- alert("Please scan or load an image first.");
127
- return;
128
- }
129
- DWObject.Addon.OCR.SetLanguage('eng');
130
- DWObject.Addon.OCR.SetOutputFormat(EnumDWT_OCROutputFormat.OCROF_TEXT);
131
- DWObject.Addon.OCR.Recognize(
132
- DWObject.CurrentImageIndexInBuffer,
133
- function (sImageIndex, result) {
134
- if (result == null)
135
- return null;
136
- var _textResult = (Dynamsoft.Lib.base64.decode(result.Get())).split(/\r?\n/g),
137
- _resultToShow = [];
138
- for (var i = 0; i < _textResult.length; i++) {
139
- if (i == 0 && _textResult[i].trim() == "")
140
- continue;
141
- _resultToShow.push(_textResult[i] + '<br />');
142
- }
143
- _resultToShow.splice(0, 0, '<p style="padding:5px; margin:0;">');
144
- _resultToShow.push('</p>');
145
- document.getElementById('divNoteMessage').innerHTML = _resultToShow.join('');
146
- },
147
- function (errorcode, errorstring, result) {
148
- alert(errorstring);
149
- }
150
- );
151
- }
152
- }
153
- </script>
154
- </body>
155
-
156
- </html>