From 52cc119445975ba840417138356e4cb4683c42a7 Mon Sep 17 00:00:00 2001 From: kyle-ds <51097593+kyle-ds@users.noreply.github.com> Date: Thu, 3 Aug 2023 13:58:05 -0700 Subject: [PATCH 1/6] Update input.md add eSCL blurb --- indepth/features/input.md | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/indepth/features/input.md b/indepth/features/input.md index 3b2a418c..71bc5956 100644 --- a/indepth/features/input.md +++ b/indepth/features/input.md @@ -22,6 +22,32 @@ A local scanner refers to a scanner that is plugged in the same desktop via USB > As far as `Dynamic Web TWAIN` is concerned, a network scanner is just like a local scanner because its driver has taken care of the network connection behind the scene. +### Scan From an eSCL Scanner +Many modern scanners and multi-functional printers (MFPs) support the eSCL protocol. The protocol is a vendor-neutral network protocol that allows driverless scanning via ethernet, wireless and USB-connected devices. eSCL-compatible scanners advertise themselves via mDNS so that we can find them easily. mDNS is a zero-configuration service. It is implemented by Apple Bonjour and the open-source Avahi software packages. +> See [this blog post](https://www.dynamsoft.com/blog/announcement/dynamic-web-twain-escl-scanner/) for more information about eSCL. + +#### Scan from an eSCL Scanner to PC +> The Dynamsoft Service must be installed on the client PC + +``` javascript +//Get a list of eSCL scanners: +let eSCLDevices = await DWObject.GetDevicesAsync(Dynamsoft.DWT.EnumDWT_DeviceType.ESCLSCANNER); + +//Scan documents from the first eSCL scanner: +let deviceConfiguration = {Resolution:100,IfShowUI:false}; // scanning configuration. Check out the docs to learn more: https://www.dynamsoft.com/web-twain/docs/info/api/WebTwain_Acquire.html#acquireimage +await eSCLDevices[0].acquireImage(deviceConfiguration, DWObject); +``` + +#### Scan from an eSCL Scanner to Android +> Install the Android Service on the client device from the [Play Store](https://play.google.com/store/apps/details?id=com.dynamsoft.mobilescan). + +``` javascript +let devices = await DWObject.GetDevicesAsync(); // get the devices list +await DWObject.SelectDeviceAsync(devices[0]); // select the first device +let deviceConfiguration = {Resolution:100,IfShowUI:false}; // scanning configuration. Check out the docs to learn more: https://www.dynamsoft.com/web-twain/docs/info/api/WebTwain_Acquire.html#acquireimage +DWObject.AcquireImageAsync(deviceConfiguration); // scan documents with the selected device +``` + ## Capture from cameras ### Use [DirectShow Cameras]({{site.getstarted}}hardware.html#directshow-cameras) From 20eb98499c75046919f05d5098e08334d2d38aed Mon Sep 17 00:00:00 2001 From: kyle-ds <51097593+kyle-ds@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:51:56 -0700 Subject: [PATCH 2/6] Update input.md --- indepth/features/input.md | 24 ++++++------------------ 1 file changed, 6 insertions(+), 18 deletions(-) diff --git a/indepth/features/input.md b/indepth/features/input.md index 71bc5956..42dadbc4 100644 --- a/indepth/features/input.md +++ b/indepth/features/input.md @@ -26,26 +26,14 @@ A local scanner refers to a scanner that is plugged in the same desktop via USB Many modern scanners and multi-functional printers (MFPs) support the eSCL protocol. The protocol is a vendor-neutral network protocol that allows driverless scanning via ethernet, wireless and USB-connected devices. eSCL-compatible scanners advertise themselves via mDNS so that we can find them easily. mDNS is a zero-configuration service. It is implemented by Apple Bonjour and the open-source Avahi software packages. > See [this blog post](https://www.dynamsoft.com/blog/announcement/dynamic-web-twain-escl-scanner/) for more information about eSCL. -#### Scan from an eSCL Scanner to PC -> The Dynamsoft Service must be installed on the client PC +- To scan from an eSCL Scanner to PC, the Dynamsoft Service must be installed on the client PC +- To scan from an eSCL Scanner to Android, you must install the Android Service on the client device from the [Play Store](https://play.google.com/store/apps/details?id=com.dynamsoft.mobilescan). +The following code shows how one way to acquire the image via the eSCL protocol. ``` javascript -//Get a list of eSCL scanners: -let eSCLDevices = await DWObject.GetDevicesAsync(Dynamsoft.DWT.EnumDWT_DeviceType.ESCLSCANNER); - -//Scan documents from the first eSCL scanner: -let deviceConfiguration = {Resolution:100,IfShowUI:false}; // scanning configuration. Check out the docs to learn more: https://www.dynamsoft.com/web-twain/docs/info/api/WebTwain_Acquire.html#acquireimage -await eSCLDevices[0].acquireImage(deviceConfiguration, DWObject); -``` - -#### Scan from an eSCL Scanner to Android -> Install the Android Service on the client device from the [Play Store](https://play.google.com/store/apps/details?id=com.dynamsoft.mobilescan). - -``` javascript -let devices = await DWObject.GetDevicesAsync(); // get the devices list -await DWObject.SelectDeviceAsync(devices[0]); // select the first device -let deviceConfiguration = {Resolution:100,IfShowUI:false}; // scanning configuration. Check out the docs to learn more: https://www.dynamsoft.com/web-twain/docs/info/api/WebTwain_Acquire.html#acquireimage -DWObject.AcquireImageAsync(deviceConfiguration); // scan documents with the selected device +let esclDeviceList=await DWObject.GetDevicesAsync(Dynamsoft.DWT.EnumDWT_DeviceType.ESCLSCANNER) +await DWObject.SelectDeviceAsync(esclDeviceList[0]) +await DWObject.AcquireImageAsync({Resolution:100,IfShowUI:false}) ``` ## Capture from cameras From 648e437e9a156836674dc33541763fe1a5147acf Mon Sep 17 00:00:00 2001 From: kyle-ds <51097593+kyle-ds@users.noreply.github.com> Date: Fri, 4 Aug 2023 12:53:15 -0700 Subject: [PATCH 3/6] Update input.md --- indepth/features/input.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indepth/features/input.md b/indepth/features/input.md index 42dadbc4..14ff378f 100644 --- a/indepth/features/input.md +++ b/indepth/features/input.md @@ -31,8 +31,13 @@ Many modern scanners and multi-functional printers (MFPs) support the eSCL proto The following code shows how one way to acquire the image via the eSCL protocol. ``` javascript +//Get the list of available eSCL scanners let esclDeviceList=await DWObject.GetDevicesAsync(Dynamsoft.DWT.EnumDWT_DeviceType.ESCLSCANNER) + +//Select the desired scanner from the list await DWObject.SelectDeviceAsync(esclDeviceList[0]) + +//Acquire image (with configuration) await DWObject.AcquireImageAsync({Resolution:100,IfShowUI:false}) ``` From e15fbd8ce681c8a74572e97c417ee1a277e01a9e Mon Sep 17 00:00:00 2001 From: kyle-ds <51097593+kyle-ds@users.noreply.github.com> Date: Thu, 10 Aug 2023 10:45:35 -0700 Subject: [PATCH 4/6] Update WebTwain_Viewer.md Fixed improper example for bind --- info/api/WebTwain_Viewer.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/info/api/WebTwain_Viewer.md b/info/api/WebTwain_Viewer.md index 732e672f..ddf14b52 100644 --- a/info/api/WebTwain_Viewer.md +++ b/info/api/WebTwain_Viewer.md @@ -62,20 +62,20 @@ bind(element: HTMLDivElement | HTMLElement) : boolean; **Example** ```javascript -var DWObject, template; +var DWObject; Dynamsoft.DWT.CreateDWTObjectEx( { - WebTwainId: "a", + WebTwainId: "dwtControl" }, function (obj) { DWObject = obj; - template = DWObject.Viewer.getElementById("dwtcontrolContainer_temp3"); - DWObject.Viewer.width=500; - DWObject.Viewer.height=600; + DWObject.Viewer.bind("dwtcontrolContainer"); + DWObject.Viewer.width=600; + DWObject.Viewer.height=800; DWObject.Viewer.show(); }, - function (errorCode, errorString) { - console.log(errorString); + function (err) { + console.log(err); }); ``` From 4912ea740e0d4be0117c063cd5217d40971c4351 Mon Sep 17 00:00:00 2001 From: kyle-ds <51097593+kyle-ds@users.noreply.github.com> Date: Fri, 11 Aug 2023 14:39:33 -0700 Subject: [PATCH 5/6] Create mobile-web-capture.md Add warning note re: plus edition for Mobile --- indepth/development/mobile-web-capture.md | 98 +++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 indepth/development/mobile-web-capture.md diff --git a/indepth/development/mobile-web-capture.md b/indepth/development/mobile-web-capture.md new file mode 100644 index 00000000..e9bca4b5 --- /dev/null +++ b/indepth/development/mobile-web-capture.md @@ -0,0 +1,98 @@ +--- +layout: default-layout +needAutoGenerateSidebar: true +title: How to enable mobile capture +keywords: Dynamic Web TWAIN, Documentation, Mobile Web Capture +breadcrumbText: Mobile Web Capture +description: Dynamic Web TWAIN SDK Documentation Mobile Web Capture Page +--- + +> [!WARNING] +> Mobile Web Capture has been removed from Dynamic Web TWAIN as of Release 18.2. If you still require Mobile Web Capture, you must use the Plus edition of Dynamic Web TWAIN v18.1. Please contact [support@dynamsoft.com](mailto:support@dynamsoft.com) for further details. + +# How to Enable Mobile Web Capture + +You can follow the steps below to use Dynamic Web TWAIN SDK to enable image capture from mobile cameras in a web page. + + + +## Start a Web application + +Create a `mobile-capture.html` and copy the `Resources` folder of Dynamic Web TWAIN, which can be found under the installation folder, to the same location. + +## Include the library + +Embed the scripts of the library, among which `dynamsoft.webtwain.addon.camera.js` is the add-on module for mobile web capture. + +``` html + + + +``` + +Add an `div` element on the page for the library. `dwtcontrolContainer` is the default ID for the div. You can change it in the file `dynamsoft.webtwain.config.js` if necessary. + +``` html +
+``` + +## Add code for mobile web capture + +The below code shows how to scan a document from scanners on desktop and invoke the camera module for mobile capture. + +``` javascript +function AcquireImage() { + if (DWObject) { + if (Dynamsoft.Lib.env.bMobile) { + var showVideoConfigs = { + scannerViewer:{ + autoDetect:{ + enableAutoDetect: true + } + }, + filterViewer: { + exitDocumentScanAfterSave: true + } + }; + + if(!DWObject.UseLocalService) { + // invoke the camera module for mobile capture + DWObject.Addon.Camera.scanDocument(showVideoConfigs).then( + function(){ + console.log("OK"); + }, + function(error){ + console.log(error.message); + }); + } + } + else { + DWObject.SelectSource( + function() { + DWObject.OpenSource(); + DWObject.AcquireImage(); + }, + function() { + console.log("SelectSource failed!"); + }); + } + } +} +``` + +## See the mobile capture page in action + +To try out the mobile web capture, please first deploy the web application as an HTTPS site so that it will get proper authentication to access the mobile cameras. + +## Try mobile capture demo + +Here is a working mobile capture online demo which you can test. + +- [Try mobile capture online demo](https://demo.dynamsoft.com/web-twain/mobile-online-camera-scanner/) +- [Download mobile capture sample code](https://www.dynamsoft.com/web-twain/sample-downloads/?demoSampleId=663) + +## Additional notes: + +1. By default, the size of the viewer is 270 in width and 350 in height, so it'll appear to be too small. Check out [how to customize the viewer]({{site.indepth}}features/viewer.html#customize-the-viewer) for more information. + +2. Important: Not all mobile browsers allow the use of cameras. Check out [browsers on mobile devices]({{site.getstarted}}platform.html#browsers-on-mobile-devices) for more information. If you are using an unsupported browser (for example, Chrome on iOS), you may receive the error `The current browser has not implemented the MediaDevices interface`. From 96d2315114dceca98fe3c92d5e87373afb421a92 Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Tue, 22 Aug 2023 15:06:44 +0800 Subject: [PATCH 6/6] Update general-troubleshooting-steps.md --- faq/general-troubleshooting-steps.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/faq/general-troubleshooting-steps.md b/faq/general-troubleshooting-steps.md index 0febb314..34fc9f48 100644 --- a/faq/general-troubleshooting-steps.md +++ b/faq/general-troubleshooting-steps.md @@ -25,8 +25,9 @@ permalink: /faq/general-troubleshooting-steps.html - Linux, `/opt/dynamsoft/DynamsoftService/log` 2. Set the log level - Option A - Single client machine troubleshooting - go to the application with Dynamic Web TWAIN integrated, press F12 to open the development tools, switch to "console" tab and enter the command "DWObject.LogLevel = 1" to enable the debugger mode. - Option B - For all client machines (application wide) - set [ `LogLevel` ]({{site.info}}api/WebTwain_Util.html#loglevel) to 1 in your code. This property should be set as soon as the `WebTwain` instance is created. For example, in the event `Dynamsoft_OnReady` + - Option A - (Only recommended for v18.0+) For only one client machine, add the line `LogLevel=14` to `DSConfiguration.ini` on that specific machine. To find the `DSConfiguration.ini` file, please return to the previous directory from the log directory. + - Option B - Single client machine troubleshooting - go to the application with Dynamic Web TWAIN integrated, press F12 to open the development tools, switch to "console" tab and enter the command `DWObject.LogLevel = 1` to enable the debugger mode. + - Option C - For all client machines (application wide) - set [ `LogLevel` ]({{site.info}}api/WebTwain_Util.html#loglevel) to 1 in your code. This property should be set as soon as the `WebTwain` instance is created. For example, in the event `Dynamsoft_OnReady` ```javascript function Dynamsoft_OnReady() { DWObject = Dynamsoft.DWT.GetWebTwain("dwtcontrolContainer");