You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
***2. Initialization succeeds, but scan/load shows blank images***
33
+
#### **2) Initialization succeeds, but scanning / loading returns blank**
34
+
Initialization appears successful, but scanned or loaded images are blank.
35
+
36
+
The browser console (F12 → Console) may show a CORS denial similar to:
34
37
35
-
The browser console (F12 → Console) shows a CORS rejection similar to:
36
38
```shell
37
-
Access to fetch at 'https://127.0.0.1:18623/fa/VersionInfo?ts=1761893667670' from origin 'https://your-domain.com' has been blocked by CORS policy: Permission was denied for this request to access the `unknown` address space.
39
+
Access to fetch at 'https://127.0.0.1:18623/fa/VersionInfo?ts=1761893667670'
40
+
from origin 'https://your-domain.com' has been blocked by CORS policy:
41
+
Permission was denied for this request to access the `unknown` address space.
38
42
```
39
43
44
+
---
45
+
46
+
#### Version-Specific Behavior
47
+
48
+
The observed behavior depends on Chromium browser version and Dynamic Web TWAIN (DWT) version:
49
+
50
+
| Browser Version | DWT Version | Resulting Symptom |
> (*) **Chromium 145, which can also block websocket, has not been officially released.**
57
+
> Behavior is based on pre-release testing and may change once the final release becomes available.
58
+
> Edge 143 and Firefox Nightly will have local network permission control as well.
59
+
40
60
### Root Cause
41
61
42
62
Chromium 142 introduces a new [Local Network Access security policy](https://chromestatus.com/feature/5152728072060928) requirement.
@@ -67,27 +87,85 @@ Please refer to:
67
87
68
88
***3. Developer Notes***
69
89
70
-
**a) Check Permission Programmatically**
90
+
**a) If Running Inside an `iframe`**
71
91
72
-
```javascript
73
-
let status =awaitnavigator.permissions.query({ name:"local-network-access" });
74
-
console.log(status.state);
75
-
```
92
+
> [!IMPORTANT]
93
+
> If Dynamic Web TWAIN is running inside an iframe from a different origin (cross-origin), you must explicitly grant local-network access in the iframe.
94
+
> If the iframe is same-origin, no additional configuration is required.
76
95
77
-
If not granted, guide users to:
96
+
To enable access, specify the `allow` attribute.
97
+
For security reasons, it is recommended to allow only the necessary origin rather than using a wildcard.
78
98
79
-
Chrome → Settings → Privacy and Security → Site Settings → Local network access
console.log(`Local network access is currently denied.\n\nPlease go to:\n${settingsUrl}\nand enable 'Local network access' permission for this site.`);
125
+
// Optionally show a UI guide or help link here.
126
+
} elseif (state ==="prompt") {
127
+
alert("To connect with the local scanning service, Chrome will ask for 'Local network access' permission.\n\nPlease click 'Allow' when prompted.");
128
+
// Proceed to init DWT after this message.
129
+
// e.g., Dynamsoft.DWT.Load() or CreateDWTObjectEx or your init DWT function
// e.g., Dynamsoft.DWT.Load() or CreateDWTObjectEx or your init DWT function
134
+
} else {
135
+
console.log("Unexpected LNA state:", state);
136
+
}
137
+
138
+
} catch (e) {
139
+
console.log("This browser does not support Chromium LNA Permissions API yet.");
140
+
// Fallback: directly initialize DWT
141
+
// Dynamsoft.DWT.Load() or CreateDWTObjectEx or your init DWT function
142
+
}
143
+
})();
89
144
```
145
+
If the permission is not granted, consider displaying a user-friendly message directing them to:
146
+
147
+
> Chrome → Settings → Privacy and Security → Site Settings → Local network access
148
+
149
+
This approach provides a more polished user experience, especially during onboarding or troubleshooting.
90
150
91
151
### Roadmap
92
152
93
153
Dynamsoft plans to add a feature that automatically detects local service connectivity and permission status. If the connection is blocked, users will be prompted with a message and directed to this FAQ page.
154
+
155
+
Here are the details:
156
+
157
+
* When local network access is blocked, prompt the user with the following dialog:
* Add a sentence about the permission in the service installation dialog, since we cannot determine whether the connection failure is due to the service not being installed or the access being blocked.
Clicking "Guide" will open the dialog shown above.
166
+
167
+
This design will be integrated in v19.3. For old versions, we can include an extra js file, which can be retrieved by contacting [support](mailto://support@dynamsoft.com).
168
+
169
+
## Other Causes
170
+
171
+
There are other causes of service not being connected. You can find them in [another FAQ](/_articles/faq/service-prompting-to-install-repeatedly.md).
Third-party generated PDF files may house multiple images, text, or annotations in a single PDF page. As these elements must be rendered within the Dynamic Web TWAIN, it will utilize the PDF rasterizer addon.
18
18
19
-
When importing a PDF file generated by Dynamic Web TWAIN, or if each page of a third-party PDF holds nothing but a single, unadulterated image, there's no need for the PDF rasterizer addon.
19
+
When importing a PDF file generated by Dynamic Web TWAIN, or if each page of a third-party PDF holds nothing but a single image, there's no need for the PDF rasterizer addon.
20
+
21
+
If you need to append images to an existing PDF and want to keep the original pages instead of rasterized images in the saved PDF, you need to enable the [`preserveUnmodifiedOnSave`](/_articles/info/api/interfaces.md#:~:text=preserveUnmodifiedOnSave){:target="_blank"} property.
Copy file name to clipboardExpand all lines: _articles/general-usage/initialization.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ For demonstration purposes, save the sample in an HTML file (e.g. `helloWorld.ht
60
60
61
61
Otherwise, click [here](/_articles/general-usage/server-deployment.md) to learn how to deploy DWT on your web server.
62
62
63
-
> If your environment does not have **Dynamic Web TWAIN Service** installed, a prompt will appear to ask you to install the service. You can learn more about what the service does [here](/_articles/faq/what-does-dynamsoft-service-do-on-end-user-machine.md).
63
+
> If your environment does not have **Dynamic Web TWAIN Service** installed or local network access is not granted, a prompt will appear to ask you to install the service. You can learn more about what the service does [here](/_articles/faq/what-does-dynamsoft-service-do-on-end-user-machine.md).
64
64
65
65
Below is more detail on what happens during initialization and how to retrieve the `WebTwain` object.
0 commit comments