From 5a59b032682360fca875f463627892df1550e5ad Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Mon, 27 Feb 2023 13:37:59 +0800 Subject: [PATCH 01/18] Update Addon_BarcodeReader.md --- info/api/Addon_BarcodeReader.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/info/api/Addon_BarcodeReader.md b/info/api/Addon_BarcodeReader.md index ba79a78a..ab63e8e8 100644 --- a/info/api/Addon_BarcodeReader.md +++ b/info/api/Addon_BarcodeReader.md @@ -158,12 +158,12 @@ interface Result { ## getRuntimeSettings -Get the current runtime settings. +Return the current runtime settings or the settings of the specified built-in template. The template can only be "speed", "balance", or "coverage". **Syntax** ```typescript -getRuntimeSettings(): Promise < RuntimeSettings > ; +getRuntimeSettings(template?: string): Promise < RuntimeSettings > ; interface RuntimeSettings { barcodeFormatIds: number; From 8598e47edd471718056b673b978a2e32aa7e2fcc Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Mon, 27 Feb 2023 18:35:50 +0800 Subject: [PATCH 02/18] Update WebTwain_Viewer.md --- info/api/WebTwain_Viewer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/info/api/WebTwain_Viewer.md b/info/api/WebTwain_Viewer.md index 20b3a7a3..fdba6b9b 100644 --- a/info/api/WebTwain_Viewer.md +++ b/info/api/WebTwain_Viewer.md @@ -70,7 +70,7 @@ Dynamsoft.DWT.CreateDWTObjectEx( DWObject = obj; template = DWObject.Viewer.getElementById("dwtcontrolContainer_temp3"); DWObject.Viewer.width=500; -    DWObject.Viewer.height=600; + DWObject.Viewer.height=600; DWObject.Viewer.show(); }, function (errorCode, errorString) { From 1141741d37b30945af030e158e7097346dd34713 Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Thu, 2 Mar 2023 18:45:47 +0800 Subject: [PATCH 03/18] update --- faq/failed-to-load-resource.md | 32 ++++++++++++++++++++++---------- faq/index.md | 2 +- 2 files changed, 23 insertions(+), 11 deletions(-) diff --git a/faq/failed-to-load-resource.md b/faq/failed-to-load-resource.md index 8d79823f..c0342de0 100644 --- a/faq/failed-to-load-resource.md +++ b/faq/failed-to-load-resource.md @@ -19,21 +19,33 @@ You get an error message that says **"Failed to load resource: net::ERR_CERT_DAT ### Cause -By default, we use "127.0.0.1" for service connection. However, you may use our "local.dynamsoft.com" certificate by setting **Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"** or **Dynamsoft.DWT.Host="local.dynamsoft.com"**. +By default, “127.0.0.1” is used for service connection. "127.0.0.1" uses a self-signed certificate because it is an internal IP address, if your environment requires high level security, self-signed certificates may not be accepted. Moreover, Android OS or Chrome OS does not accept connection between browsers and Dynamsoft Service via "127.0.0.1". -Ref: In which cases would I use local.dynamsoft.com instead of 127.0.0.1? +1. In case, you used our expired certificate - local.dynamsoft.com, as an official domain which uses a VeriSign’ed certificate. The old "local.dynamsoft.com" certificate expired on January 9th, 2023 + > ___Please note:___ _all official certificates issued by 3rd party come with an expiry date - generally one year. This means that each year the certificate will need to be updated if local.dynamsoft.com is used._ -In this case, if you are trying to access an application that integrates a version of Dynamic Web TWAIN V15.3 ~ V17.2.5, you will get the error. Because the old "local.dynamsoft.com" certificate expired on January 9th, 2023. +2. Your own domain certificate expired. -### Resolution + -- For v17.1.1 or older versions, choose one of the following approaches: +### Resolution + +- **No High Level Security Requirement**: + + Set back to "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. + +- **[Highly Recommend] High Level Security Requirement** + +1. Set back to "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. +2. Replace the certificate of "127.0.0.1" with your own domain certificate and build Service MSI yourself. More information refer to [How can I change the certificate of the Dynamsoft Service?](https://www.dynamsoft.com/web-twain/docs/faq/change-dynamsoft-service-certificate.html). + + -- For v17.2 or higher versions, use the new API UpdateCert to automatically update the client side certificate before it expires. **Please go to dynamsoft.webtwain.install.js file in the Resource Folder and search the keyword "OnSSLCertInfo"**, add the following lines of code: +
  • How do I upgrade my project to use the latest version of the Dynamic Web TWAIN SDK?
  • From 0b843543cc577146f7a7593a0b276b576736b0d4 Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Thu, 2 Mar 2023 18:48:33 +0800 Subject: [PATCH 04/18] Update failed-to-load-resource.md --- faq/failed-to-load-resource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faq/failed-to-load-resource.md b/faq/failed-to-load-resource.md index c0342de0..68572c98 100644 --- a/faq/failed-to-load-resource.md +++ b/faq/failed-to-load-resource.md @@ -21,7 +21,7 @@ You get an error message that says **"Failed to load resource: net::ERR_CERT_DAT By default, “127.0.0.1” is used for service connection. "127.0.0.1" uses a self-signed certificate because it is an internal IP address, if your environment requires high level security, self-signed certificates may not be accepted. Moreover, Android OS or Chrome OS does not accept connection between browsers and Dynamsoft Service via "127.0.0.1". -1. In case, you used our expired certificate - local.dynamsoft.com, as an official domain which uses a VeriSign’ed certificate. The old "local.dynamsoft.com" certificate expired on January 9th, 2023 +1. In case, you used our expired certificate - local.dynamsoft.com, as an official domain which uses a VeriSign’ed certificate. The old "local.dynamsoft.com" certificate expired on January 9th, 2023 and the new certificate will expire on December 8th, 2023 > ___Please note:___ _all official certificates issued by 3rd party come with an expiry date - generally one year. This means that each year the certificate will need to be updated if local.dynamsoft.com is used._ 2. Your own domain certificate expired. From 6d1f8adaa483af8be498bb5873ed1761ca2ef19b Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Thu, 2 Mar 2023 18:56:26 +0800 Subject: [PATCH 05/18] Update failed-to-load-resource.md --- faq/failed-to-load-resource.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/faq/failed-to-load-resource.md b/faq/failed-to-load-resource.md index 68572c98..c2e6bfd2 100644 --- a/faq/failed-to-load-resource.md +++ b/faq/failed-to-load-resource.md @@ -45,22 +45,22 @@ By default, “127.0.0.1” is used for service connection. "127.0.0.1" uses a s > Note: the new certificate from Dynamsoft will expire on December 8th, 2023. This means you must update the certificate again after this certificate expires. - Method 3. Contact Dynamsoft for a new MSI for client-side. --> - + ``` -
  • How do I upgrade my project to use the latest version of the Dynamic Web TWAIN SDK?
  • How do I upgrade the end-user installation for all end users once I upgrade my project?
  • From 7c6903f67e7c7608487faf8a39852fa0233f096c Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:16:49 +0800 Subject: [PATCH 07/18] Update failed-to-load-resource.md --- faq/failed-to-load-resource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faq/failed-to-load-resource.md b/faq/failed-to-load-resource.md index a7746a44..5c0e0575 100644 --- a/faq/failed-to-load-resource.md +++ b/faq/failed-to-load-resource.md @@ -32,7 +32,7 @@ By default, “127.0.0.1” is used for service connection. "127.0.0.1" uses a s - **No High Level Security Requirement**: - Set back to "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. + Set back to "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. No need to worry about the expiry date of the certificate anymore. - **[Highly Recommend] High Level Security Requirement** From 1159c0c3346818dc9ef1fd6e4b08a150ded0314a Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Thu, 2 Mar 2023 19:18:40 +0800 Subject: [PATCH 08/18] Update failed-to-load-resource.md --- faq/failed-to-load-resource.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/faq/failed-to-load-resource.md b/faq/failed-to-load-resource.md index 5c0e0575..e26f51d5 100644 --- a/faq/failed-to-load-resource.md +++ b/faq/failed-to-load-resource.md @@ -32,7 +32,7 @@ By default, “127.0.0.1” is used for service connection. "127.0.0.1" uses a s - **No High Level Security Requirement**: - Set back to "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. No need to worry about the expiry date of the certificate anymore. + Set back to self-signed certificate "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. No need to worry about the expiry date of the certificate anymore. - **[Highly Recommend] High Level Security Requirement** From eda034eea34e7b4eeddc16c65683b2941cd78c1d Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Fri, 3 Mar 2023 11:27:34 +0800 Subject: [PATCH 09/18] Update failed-to-load-resource.md --- faq/failed-to-load-resource.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/faq/failed-to-load-resource.md b/faq/failed-to-load-resource.md index e26f51d5..40cb4005 100644 --- a/faq/failed-to-load-resource.md +++ b/faq/failed-to-load-resource.md @@ -34,7 +34,7 @@ By default, “127.0.0.1” is used for service connection. "127.0.0.1" uses a s Set back to self-signed certificate "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. No need to worry about the expiry date of the certificate anymore. -- **[Highly Recommend] High Level Security Requirement** +- **High Level Security Requirement** 1. Set back to "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. 2. Replace the certificate of "127.0.0.1" with your own domain certificate and build Service MSI yourself. More information refer to [How can I change the certificate of the Dynamsoft Service?](https://www.dynamsoft.com/web-twain/docs/faq/change-dynamsoft-service-certificate.html) @@ -45,7 +45,7 @@ By default, “127.0.0.1” is used for service connection. "127.0.0.1" uses a s > Note: the new certificate from Dynamsoft will expire on December 8th, 2023. This means you must update the certificate again after this certificate expires. - Method 3. Contact Dynamsoft for a new MSI for client-side. --> -- For v17.2 or higher versions, you can use the new API UpdateCert to automatically update client side certificate before it expires. **Please go to dynamsoft.webtwain.install.js file in the Resource Folder and search the keyword "OnSSLCertInfo"**, add the following lines of code: + diff --git a/info/api/WebTwain_Viewer.md b/info/api/WebTwain_Viewer.md index fdba6b9b..3e169aa7 100644 --- a/info/api/WebTwain_Viewer.md +++ b/info/api/WebTwain_Viewer.md @@ -2069,16 +2069,16 @@ The default value is null. You can specify the border by CSS. Read more on the [ ## pageMargin +Return or set the margin between images. + **Syntax** ```typescript -/** - * Return or set the margin between images. - */ pageMargin: number | string; ``` **Availability** +
    @@ -2101,30 +2101,30 @@ pageMargin: number | string;
    +**Usage Notes** + +The page margin is only effective when the view mode is not -1 \* -1 (in other words, [ `singlePageMode` ](#singlepagemode) is `false` ). + **Example** ```javascript DWObject.Viewer.pageMargin = 10; ``` -**Usage Notes** - -The page margin is only effective when the view mode is not -1 \* -1 (in other words, [ `singlePageMode` ](#singlepagemode) is `false` ). - --- ## selectedAreaBorderColor +Set the border color of the selected area. Also applies to the selection box on the video opened by the method `showVideo`. + **Syntax** ```typescript -/** - * Set the border color of the selected area. Also applies to the selection box on the video opened by the method `showVideo`. - */ selectedAreaBorderColor: string; ``` **Availability** +
    @@ -2147,30 +2147,30 @@ selectedAreaBorderColor: string;
    +**Usage notes** + +The default value is "rgba(0, 0, 0, 1)". + **Example** ```javascript DWObject.Viewer.selectedAreaBorderColor = "rgba(0, 0, 0, 1)"; ``` -**Usage notes** - -The default value is "rgba(0, 0, 0, 1)". - --- ## selectedPageBackground +Set the selected page background color of the Thumbnail viewer. + **Syntax** ```typescript -/** - * Set the selected page background color of the Thumbnail viewer. - */ selectedPageBackground: string; ``` **Availability** +
    @@ -2193,30 +2193,30 @@ selectedPageBackground: string;
    +**Usage notes** + +The default value is "rgb(199, 222, 252)". You can specify the backgournd by CSS which may be a single color or even an image. Read more on the [background shorthand CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/background). + **Example** ```javascript DWObject.Viewer.selectedPageBackground = "rgb(255, 0, 0)"; ``` -**Usage notes** - -The default value is "rgb(199, 222, 252)". You can specify the backgournd by CSS which may be a single color or even an image. Read more on the [background shorthand CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/background). - --- ## selectedPageBorder +Return or set the border style for selected page(s). + **Syntax** ```typescript -/** - * Return or set the border style for selected page(s). - */ selectedPageBorder: string; ``` **Availability** +
    @@ -2239,32 +2239,32 @@ selectedPageBorder: string;
    -**Example** - -```javascript -DWObject.Viewer.selectedPageBorder = "3px solid rgb(125,162,206)"; -``` - **Usage Notes** This API is only effective when the view mode is not -1 \* -1 (in other words, [ `singlePageMode` ](#singlepagemode) is `false` ). The default value is "1px solid rgb(125, 162, 206)". Now you can specify the border by CSS. Read more on the [border shorthand CSS](https://developer.mozilla.org/en-US/docs/Web/CSS/border). +**Example** + +```javascript +DWObject.Viewer.selectedPageBorder = "3px solid rgb(125,162,206)"; +``` + --- ## selectionRectAspectRatio +Specify an aspect ratio to be used when selecting an rectangular area on a page. + **Syntax** ```typescript -/** - * Specify an aspect ratio to be used when selecting an rectangular area on a page. - */ selectionRectAspectRatio: number | string; ``` **Availability** +
    @@ -2287,30 +2287,30 @@ selectionRectAspectRatio: number | string;
    +**Usage Notes** + +This API is only effective when drawing manually (it won't work if the selection is done with the API [`setSelectedAreas()`](#setselectedareas)). + **Example** ```javascript DWObject.Viewer.selectionRectAspectRatio = 0.5; ``` -**Usage Notes** - -This API is only effective when drawing manually (it won't work if the selection is done with the API [`setSelectedAreas()`](#setselectedareas)). - --- ## singlePageMode +Set whether to use single page mode. + **Syntax** ```typescript -/** - * Set whether to use single page mode. - */ singlePageMode: boolean; ``` **Availability** +
    @@ -2333,6 +2333,10 @@ singlePageMode: boolean;
    +**Usage notes** + +The default value is `false`. If the thumbnail viewer is not shown, setting `singlePageMode` to `true` is equivalent to setting the view mode to -1 by -1. But if the thumbnail viewer is shown, `singlePageMode` will be changed to `true` automatically. + **Example** ```javascript @@ -2347,24 +2351,20 @@ objThumbnailViewer.show(); DWObject.Viewer.singlePageMode = true; ``` -**Usage notes** - -The default value is `false`. If the thumbnail viewer is not shown, setting `singlePageMode` to `true` is equivalent to setting the view mode to -1 by -1. But if the thumbnail viewer is shown, `singlePageMode` will be changed to `true` automatically. - --- ## width +Return or set the width of the viewer. + **Syntax** ```typescript -/** - * Return or set the width of the viewer. - */ width: number | string; ``` **Availability** +
    @@ -2387,6 +2387,12 @@ width: number | string;
    +**Usage Notes** + +If a number is assigned, it means that number of pixels (px). If a string is assigned, it is either a fixed size like "500px" or a dynamic size like "50%" which follows standard CSS rules. + +When reading the property, the value is always in pixels no matter what value was set to it. + **Example** ```javascript @@ -2395,26 +2401,20 @@ DWObject.Viewer.width = "270px"; DWObject.Viewer.width = "100%"; ``` -**Usage Notes** - -If a number is assigned, it means that number of pixels (px). If a string is assigned, it is either a fixed size like "500px" or a dynamic size like "50%" which follows standard CSS rules. - -When reading the property, the value is always in pixels no matter what value was set to it. - --- ## zoom +Return or set the zoom factor, and then the current page will be enlarged or reduced. + **Syntax** ```typescript -/** - * Return or set the zoom factor, and then the current page will be enlarged or reduced. - */ zoom: number; ``` **Availability** +
    @@ -2437,30 +2437,30 @@ zoom: number;
    +**Usage Notes** + +The zoom factor is only effective when the view mode is -1 \* -1. Allowed values is from 0.02 to 65. + **Example** ```javascript DWObject.Viewer.zoom = 2.0; ``` -**Usage Notes** - -The zoom factor is only effective when the view mode is -1 \* -1. Allowed values is from 0.02 to 65. - --- ## autoChangeIndex +Set whether to make sure the first image in the viewer is always selected when scrolling through multiple images. The default value is false. + **Syntax** ```typescript -/** - * Set whether to make sure the first image in the viewer is always selected when scrolling through multiple images. The default value is false. - */ autoChangeIndex: boolean; ``` **Availability** +
    @@ -2483,27 +2483,25 @@ autoChangeIndex: boolean;
    +**Usage Notes** + +When set to true, the index in the upper left corner of the viewer will be selected when scrolling. + **Example** ```javascript DWObject.Viewer.autoChangeIndex = true; ``` -**Usage Notes** - -When set to true, the index in the upper left corner of the viewer will be selected when scrolling. - --- ## updateCheckboxStyle +Update checkbox style + **Syntax** ```typescript -/** - * Update checkbox style - * @argument checkboxSettings Settings for checkboxex. - */ updateCheckboxStyle(checkboxSettings?: CheckboxSettings): void; interface CheckboxSettings { @@ -2527,7 +2525,12 @@ interface CheckboxSettings { ``` +**Parameters** + +`checkboxSettings`: Settings for checkboxex. + **Availability** +
    @@ -2554,13 +2557,11 @@ interface CheckboxSettings { ## updatePageNumberStyle +Update page number style + **Syntax** ```typescript -/** - * Update page number style - * @argument pageNumberSettings Settings for page numbers. - */ updatePageNumberStyle(pageNumberSettings?: PageNumberSettings): void; interface pageNumberSettings { @@ -2582,10 +2583,14 @@ interface pageNumberSettings { translateX?: number | string; //default: "", number unit: px, string value: "10px"/"10%", relative to itself translateY?: number | string //default: "", number unit: px, string value: "10px"/"10%", relative to itself } - ``` +**Parameters** + +`pageNumberSettings`: Settings for page numbers. + **Availability** +
    @@ -2612,16 +2617,16 @@ interface pageNumberSettings { ## selectionMode +Return or set the selection mode used. + **Syntax** ```typescript -/** - * Return or set the selection mode used. - */ selectionMode: Dynamsoft.DWT.EnumDWT_SelectionMode | number; ``` **Availability** +
    @@ -2644,6 +2649,10 @@ selectionMode: Dynamsoft.DWT.EnumDWT_SelectionMode | number;
    +**Usage notes** + +The default value is 0 (Single). Even if checkbox is used, only one image can be selected if the selection mode is set to 0 (Single). + **Example** ```javascript @@ -2655,10 +2664,6 @@ DWObject.Viewer.updateCheckboxStyle({ DWObject.Viewer.selectionMode = Dynamsoft.DWT.EnumDWT_SelectionMode.Multiple; // Multiple Selection ``` -**Usage notes** - -The default value is 0 (Single). Even if checkbox is used, only one image can be selected if the selection mode is set to 0 (Single). - --- @@ -2666,19 +2671,14 @@ The default value is 0 (Single). Even if checkbox is used, only one image can be ### On +Built-in callbacks that are triggered for a certain mouse event or keyboard event on a page. + **Syntax** ```typescript -/** - * Built-in callbacks that are triggered for a certain mouse event or keyboard event on a page. - * @param eventName Specify the event. Value: click, contextmenu, dblclick, mousemove, mousedown, mouseup, mouseout, mouseover, keydown, keyup. - * @param callback Specify the callback. - * @argument dwtEvent The viewer-specific event object. - * @argument domEvent The original mouse event object. - */ on( eventName: string, - callback: (event: ViewerEvent | KeyboardEvent, domEvent: MouseEvent) => void + callback: (dwtEvent: ViewerEvent | KeyboardEvent, domEvent: MouseEvent) => void ): void; interface ViewerEvent{ @@ -2695,6 +2695,43 @@ interface ViewerEvent{ }; ``` +**Parameters** + +`eventName`: Specify the event. Value: click, contextmenu, dblclick, mousemove, mousedown, mouseup, mouseout, mouseover, keydown, keyup. + +`callback`: Specify the callback. +- `dwtEvent`: The viewer-specific event object. +- `domEvent`: The original mouse event object. + +**Availability** + +
    + + + + + + + + + + + + + + + + + + +
    ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
    v16.2+ (partially supported) v16.2+ v16.2+ v16.2+ v16.2+
    +
    + +**Usage notes** + +The events `mouseout`, `mouseover`, `keydown` and `keyup` are only triggered on desktop browsers. +The events `click`, `dbclick`, `mousemove`, `pageAreaSelected`, and `pageAreaUnselected` are supported in ActiveX. + **Example** ```javascript @@ -2739,46 +2776,15 @@ DWObject.Viewer.on("keyup", function (keyboardEvent) { }); ``` -**Availability** -
    - - - - - - - - - - - - - - - - - - -
    ActiveXH5(Windows)H5(macOS/TWAIN)H5(macOS/ICA)H5(Linux)
    v16.2+ (partially supported) v16.2+ v16.2+ v16.2+ v16.2+
    -
    - -**Usage notes** - -The events `mouseout`, `mouseover`, `keydown` and `keyup` are only triggered on desktop browsers. -The events `click`, `dbclick`, `mousemove`, `pageAreaSelected`, and `pageAreaUnselected` are supported in ActiveX. - --- ### pageAreaSelected +This event is triggered when user selects an area (draws a rectangle) or move a selected area on the current page. + **Syntax** ```typescript -/** - * This event is triggered when user selects an area (draws a rectangle) or move a selected area on the current page. - * @argument index The index of the current page. - * @argument rect Some attribute values of the selected area. - */ on('pageAreaSelected', (index: number, rect: rect)=> void ): void; @@ -2797,7 +2803,14 @@ interface rect{ }; ``` +**Parameters** + +`index`: The index of the current page. + +`rect`: Some attribute values of the selected area. + **Availability** +
    @@ -2834,19 +2847,22 @@ DWObject.Viewer.off("pageAreaSelected"); ### pageAreaUnselected +This event is triggered when selected area(s) get cleared (when the user clicks outside of the drawn rectangle). + **Syntax** ```typescript -/** - * This event is triggered when selected area(s) get cleared (when the user clicks outside of the drawn rectangle). - * @argument index The index of the current page. - */ on('pageAreaUnselected', (index: number) => void ): void; ``` +**Parameters** + +`index`: The index of the current page. + **Availability** +
    @@ -2887,19 +2903,22 @@ DWObject.Viewer.off("pageAreaUnselected"); ### pageRendered +This event is triggered when a page is rendered. + **Syntax** ```typescript -/** - * This event is triggered when a page is rendered. - * @argument index The index of the current page. - */ on('pageRendered', (index: number) => void ): void; ``` +**Parameters** + +`index`: The index of the current page. + **Availability** +
    @@ -2935,20 +2954,24 @@ DWObject.Viewer.render(); //It will trigger the pageRendered event ### resize +This event is triggered when width & height of the viewer has been changed. + **Syntax** ```typescript -/** - * This event is triggered when width & height of the viewer has been changed. - * @argument width The new width of the viewer. - * @argument height The new height of the viewer. - */ on('resize', (width: number, height: number) => void ): void; ``` +**Parameters** + +`width`: The new width of the viewer. + +`height`: The new height of the viewer. + **Availability** +
    From e50561b53a5bd9c63e750847a116f0ea8c3727df Mon Sep 17 00:00:00 2001 From: ztyyLV <97287824+ztyyLV@users.noreply.github.com> Date: Fri, 3 Mar 2023 17:04:23 +0800 Subject: [PATCH 11/18] Update WebTwain_Edit.md --- info/api/WebTwain_Edit.md | 420 ++++++++++++++++++++++---------------- 1 file changed, 241 insertions(+), 179 deletions(-) diff --git a/info/api/WebTwain_Edit.md b/info/api/WebTwain_Edit.md index 634823e3..059e0122 100644 --- a/info/api/WebTwain_Edit.md +++ b/info/api/WebTwain_Edit.md @@ -370,28 +370,30 @@ ConvertToGrayScaleAsync( ## Invert +Invert the colour of the pixels on the specified image. + **Syntax** ```typescript -/** - * Invert the colour of the pixels on the specified image. - * @param index Specify the image. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ Invert( index: number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -418,30 +420,33 @@ Invert( ## SetImageWidth +Change the width of the specified image by adding a margin or removing part of the image. + **Syntax** ```typescript -/** - * Change the width of the specified image by adding a margin or removing part of the image. - * @param index Specify the image. - * @param width Specify the new width. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ SetImageWidth( index: number, width: number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`width`: Specify the new width. + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -468,28 +473,30 @@ SetImageWidth( ## Flip +Flip the specified image. + **Syntax** ```typescript -/** - * Flip the specified image. - * @param index Specify the image. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ Flip( index: number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + + `successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -534,28 +541,30 @@ FlipAsync( ## Mirror +Mirror the specified image. + **Syntax** ```typescript -/** - * Mirror the specified image. - * @param index Specify the image. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ Mirror( index: number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -599,28 +608,30 @@ MirrorAsync( ## RotateLeft +Rotate the specified image 90 degrees counterclockwise. + **Syntax** ```typescript -/** - * Rotate the specified image 90 degrees counterclockwise. - * @param index Specify the image. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ RotateLeft( index: number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -664,28 +675,30 @@ RotateLeftAsync( ## RotateRight +Rotate the specified image 90 degrees clockwise. + **Syntax** ```typescript -/** - * Rotate the specified image 90 degrees clockwise. - * @param index Specify the image. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ RotateRight( index: number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -729,32 +742,36 @@ RotateRightAsync( ## Rotate +Rotate the specified image by the specified angle. + **Syntax** ```typescript -/** - * Rotate the specified image by the specified angle. - * @param index Specify the image. - * @param angle Specify the angle. - * @param keepSize Whether to keep the original size. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ Rotate( index: number, angle: number, keepSize: boolean, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`angle`: Specify the angle. + +`keepSize`: Whether to keep the original size. + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -803,34 +820,39 @@ RotateAsync( ## RotateEx +Rotate the specified image by the specified angle. + **Syntax** ```typescript -/** - * Rotate the specified image by the specified angle. - * @param index Specify the image. - * @param angle Specify the angle. - * @param keepSize Whether to keep the original size. - * @param method Specify the algorithm for the change. - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ RotateEx( index: number, angle: number, keepSize: boolean, method: Dynamsoft.DWT.EnumDWT_InterpolationMethod | number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`angle`: Specify the angle. + +`keepSize`: Whether to keep the original size. + +`method`: Specify the algorithm for the change. Please refer to [Dynamsoft.DWT.EnumDWT_InterpolationMethod]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_interpolationmethod). + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -853,29 +875,15 @@ RotateEx(
    -**Usage notes** - -Check out [ `Dynamsoft.DWT.EnumDWT_InterpolationMethod` ]({{site.info}}api/Dynamsoft_Enum.html#dynamsoftdwtenumdwt_interpolationmethod). - --- ## Crop +Crop the specified image using the specified coordinates. + **Syntax** ```typescript -/** - * Crop the specified image using the specified coordinates. - * @param index Specify the image. - * @param left Specify the rectangle (leftmost coordinate). - * @param top Specify the rectangle (topmost coordinate). - * @param right Specify the rectangle (rightmost coordinate). - * @param bottom Specify the rectangle (bottommost coordinate). - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ Crop( index: number, left: number, @@ -883,14 +891,30 @@ Crop( right: number, bottom: number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`left`: Specify the rectangle (leftmost coordinate). + +`top`: Specify the rectangle (topmost coordinate). + +`right`: Specify the rectangle (rightmost coordinate). + +`bottom`: Specify the rectangle (bottommost coordinate). + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -917,21 +941,11 @@ Crop( ## Erase +Erase a rectangular area from the specified image. + **Syntax** ```typescript -/** - * Erase a rectangular area from the specified image. - * @param index Specify the image. - * @param left Specify the rectangle (leftmost coordinate). - * @param top Specify the rectangle (topmost coordinate). - * @param right Specify the rectangle (rightmost coordinate). - * @param bottom Specify the rectangle (bottommost coordinate). - * @param successCallback A callback function that is executed if the request succeeds. - * @param failureCallback A callback function that is executed if the request fails. - * @argument errorCode The error code. - * @argument errorString The error string. - */ Erase( index: number, left: number, @@ -939,14 +953,30 @@ Erase( right: number, bottom: number, successCallback?: () => void, - failureCallback?: ( - errorCode: number, - errorString: string - ) => void + failureCallback?: (errorCode: number, errorString: string) => void ): void | boolean; ``` +**Parameters** + +`index`: Specify the image. + +`left`: Specify the rectangle (leftmost coordinate). + +`top`: Specify the rectangle (topmost coordinate). + +`right`: Specify the rectangle (rightmost coordinate). + +`bottom`: Specify the rectangle (bottommost coordinate). + +`successCallback`: A callback function that is executed if the request succeeds. + +`failureCallback`: A callback function that is executed if the request fails. +- `errorCode`: The error code. +- `errorString`: The error string. + **Availability** +
    @@ -973,17 +1003,20 @@ Erase( ## CopyToClipboard +Copy the specified image to the clipboard of the operating system. + **Syntax** ```typescript -/** - * Copy the specified image to the clipboard of the operating system. - * @param index Specify the image. - */ CopyToClipboard(index: number): boolean; ``` +**Parameters** + +`index`: Specify the image. + **Availability** +
    @@ -1006,7 +1039,6 @@ CopyToClipboard(index: number): boolean;
    - --- ### Resolution - **No High Level Security Requirement**: - Set back to self-signed certificate "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. No need to worry about the expiry date of the certificate anymore. -- **High Level Security Requirement** - -1. Set back to "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. -2. Replace the certificate of "127.0.0.1" with your own domain certificate and build Service MSI yourself. More information refer to [How can I change the certificate of the Dynamsoft Service?](https://www.dynamsoft.com/web-twain/docs/faq/change-dynamsoft-service-certificate.html) - - - - - + }; + ``` + ***Please be aware of that the download may not work properly in all environments due to your company's security policy.*** @@ -33,18 +33,18 @@ In case, you used our expired certificate - local.dynamsoft.com, as an official - **No High Level Security Requirement**: Set back to self-signed certificate "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. No need to worry about the expiry date of the certificate anymore. -- **High Level Security Requirement (Pay attention: you need to replace the certificate annually due to expiration)** - 1. (**Recommend**) Set back to self-signed certificate "127.0.0.1". Dynamsoft understand the importance of information security and are committed to remaining one of the most security-compliant companies in the industry. Starting from April 9,2021, Dynamsoft become ISO 27001 certified. Though you are using a self-sign certificate, but all connections are limited to the device itself (127.0.0.1) which ensures the security in most cases. +- **High Level Security Requirement (Please note: you need to replace the certificate annually due to expiration)** + 1. (**Recommend**) Revert back to the self-signed certificate for "127.0.0.1". Dynamsoft understands the importance of information security and are committed to remaining one of the most security-compliant companies in the industry. Starting from April 9,2021, Dynamsoft become ISO 27001 certified. Although a self-sign certificate is being used all connections are limited to the device itself (127.0.0.1) which ensures the security in most cases. 2. If you have to use "local.dynamsoft.com", the following methods can be taken: - - Method 1 (**Recommend**). Take the advantage of new feature -- **Remote Scan** which released in v18.0. With Remote Scan, you can limit the number of Dynamsoft Service Installations to the minimum. For more details, please refer to [What is Remote Scan](https://www.dynamsoft.com/remote-scan/docs/introduction/). + - Method 1 (**Recommended**). Take advantage of the new feature -- **Remote Scan** which released in v18.0. With Remote Scan, you can limit the number of Dynamsoft Service Installations to a minimum. For more details, please refer to [What is Remote Scan](https://www.dynamsoft.com/remote-scan/docs/introduction/). - Method 2. If you must fix the issue on a few client machines immediately, manually update the following cert files on the client-side machine. Click here to download the new certificate and use the new server.pem.ldsc & server_key.pem.ldsc to replace the old one under **`C:\Windows\SysWOW64\Dynamsoft\DynamsoftService(DynamsoftServicex64)\cert`**. Then restart Dynamsoft Service. > Note: the new certificate from Dynamsoft will expire on December 8th, 2023. This means you must update the certificate again after this certificate expires. - - Method 3. Contact Dynamsoft for a new MSI for client-side. + - Method 3. Contact Dynamsoft for a new MSI for client-side. Please specify the exact service version build number found from the version your client currently has installed. - - Method 4 (**Convenience but not recommend**). For v17.2 or higher versions, you can use the new API UpdateCert to automatically update client side certificate before it expires. **Please go to dynamsoft.webtwain.install.js file in the Resource Folder and search the keyword "OnSSLCertInfo"**, add the following lines of code: + - Method 4 (**Convenience but not recommend**). For v17.2 or higher versions, you can use the new API UpdateCert to automatically update the client side certificate before it expires. **Please go to dynamsoft.webtwain.install.js file in the Resource Folder and search the keyword "OnSSLCertInfo"**, add the following lines of code: ```javascript Dynamsoft.OnSSLCertInfo = function (sslExpiredDate) { if ((sslExpiredDate - new Date()) / 86400000 < 15) { // Automatically updates 15 days before expiration @@ -60,7 +60,7 @@ In case, you used our expired certificate - local.dynamsoft.com, as an official } }; ``` - ***Please be aware of that the download may not work properly in all environments due to your company's security policy.*** + ***Please be aware that the download may not work properly in all environments due to your company's security policy.*** @@ -33,23 +33,23 @@ In case, you used our expired certificate - local.dynamsoft.com, as an official - **No High Level Security Requirement**: Set back to self-signed certificate "127.0.0.1" by comment the line `Dynamsoft.WebTwainEnv.Host = "local.dynamsoft.com"` or `Dynamsoft.DWT.Host="local.dynamsoft.com"` out. No need to worry about the expiry date of the certificate anymore. -- **High Level Security Requirement (Pay attention: you need to replace the certificate annually due to expiration)** - 1. (**Recommend**) Set back to self-signed certificate "127.0.0.1". Dynamsoft understand the importance of information security and are committed to remaining one of the most security-compliant companies in the industry. Starting from April 9,2021, Dynamsoft become ISO 27001 certified. Though you are using a self-sign certificate, but all connections are limited to the device itself (127.0.0.1) which ensures the security in most cases. +- **High Level Security Requirement (Please note: you need to replace the certificate annually due to expiration)** + 1. (**Recommended**) Revert back to the self-signed certificate for "127.0.0.1". Dynamsoft understands the importance of information security and are committed to remaining one of the most security-compliant companies in the industry. Starting from April 9,2021, Dynamsoft becomes ISO 27001 certified. Although a self-sign certificate is being used all connections are limited to the device itself (127.0.0.1) which ensures security in most cases. 2. If you have to use "local.dynamsoft.com", the following methods can be taken: - - Method 1 (**Recommend**). Take the advantage of new feature -- **Remote Scan** which released in v18.0. With Remote Scan, you can limit the number of Dynamsoft Service Installations to the minimum. For more details, please refer to [What is Remote Scan](https://www.dynamsoft.com/remote-scan/docs/introduction/). + - Method 1 (**Recommended**). Take advantage of the new feature -- **Remote Scan** which released in v18.0. With Remote Scan, you can limit the number of Dynamsoft Service Installations to a minimum. For more details, please refer to [What is Remote Scan](https://www.dynamsoft.com/remote-scan/docs/introduction/). - Method 2. If you must fix the issue on a few client machines immediately, manually update the following cert files on the client-side machine. Click here to download the new certificate and use the new server.pem.ldsc & server_key.pem.ldsc to replace the old one under **`C:\Windows\SysWOW64\Dynamsoft\DynamsoftService(DynamsoftServicex64)\cert`**. Then restart Dynamsoft Service. > Note: the new certificate from Dynamsoft will expire on December 8th, 2023. This means you must update the certificate again after this certificate expires. - - Method 3. Contact Dynamsoft for a new MSI for client-side. + - Method 3. Contact Dynamsoft for a new MSI for client-side. Please specify the exact service version build number found from the version your client currently has installed. - - Method 4 (**Convenience but not recommend**). For v17.2 or higher versions, you can use the new API UpdateCert to automatically update client side certificate before it expires. **Please go to dynamsoft.webtwain.install.js file in the Resource Folder and search the keyword "OnSSLCertInfo"**, add the following lines of code: + - Method 4 (**Convenience but not recommend**). For v17.2 or higher versions, you can use the new API UpdateCert to automatically update the client side certificate before it expires. **Please go to dynamsoft.webtwain.install.js file in the Resource Folder and search the keyword "OnSSLCertInfo"**, add the following lines of code: ```javascript Dynamsoft.OnSSLCertInfo = function (sslExpiredDate) { if ((sslExpiredDate - new Date()) / 86400000 < 15) { // Automatically updates 15 days before expiration Dynamsoft.DWT.UpdateCert( - "https://tst.dynamsoft.com/public/download/dwt/newcert/local.dynamsoft.com/newcert.zip", //You may use your own URL to where the new certificate is placed. + "https://demo.dynamsoft.com/DWT/Resources/dist/cert.zip", //You may use your own URL to where the new certificate is placed. function () { //Success callback }, @@ -60,7 +60,7 @@ In case, you used our expired certificate - local.dynamsoft.com, as an official } }; ``` - ***Please be aware of that the download may not work properly in all environments due to your company's security policy.*** + ***Please be aware that the download may not work properly in all environments due to your company's security policy.***