Skip to content

Commit eb0abde

Browse files
committed
Update output.md
1 parent b1af527 commit eb0abde

File tree

1 file changed

+20
-26
lines changed

1 file changed

+20
-26
lines changed

indepth/features/output.md

Lines changed: 20 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,6 @@ DWObject.FTPUpload(
277277

278278
### Show dialog to save
279279

280-
> Supported on [desktop]({{site.getstarted}}platform.html#browsers-on-desktop-devices).
281-
282280
You can set the [ `IfShowFileDialog` ]({{site.info}}api/WebTwain_IO.html#ifshowfiledialog) property to `true` , which will show the open/save file dialog whenever you save an image(s) within the `DWT` buffer
283281

284282
``` javascript
@@ -296,8 +294,6 @@ DWObject.SaveAllAsPDF("Sample.pdf",
296294

297295
### Save to an absolute path
298296

299-
> Supported on [desktop]({{site.getstarted}}platform.html#browsers-on-desktop-devices).
300-
301297
If you don't want to show any dialog and you know for sure where you want the files saved, you can save with absolute paths while setting [ `IfShowFileDialog` ]({{site.info}}api/WebTwain_IO.html#ifshowfiledialog) to `false` .
302298

303299
> When using an absolute path, you must make sure the current user has the proper permission to save to that path. Otherwise the save will fail.
@@ -314,28 +310,6 @@ DWObject.SaveAllAsPDF("D:\\Sample.pdf",
314310
);
315311
```
316312

317-
### Save as a download
318-
319-
> Supported on [WASM browsers]({{site.getstarted}}platform.html#wasm-browsers).
320-
321-
In [WASM browsers]({{site.getstarted}}platform.html#wasm-browsers), `DWT` runs its entire operations within the browser. So saving locally triggers will instead download the file and [ `IfShowFileDialog` ]({{site.info}}api/WebTwain_IO.html#ifshowfiledialog) will have no effect.
322-
323-
``` javascript
324-
// The following line only works on desktop but it
325-
// doesn't throw errors on WASM browsers either
326-
DWObject.IfShowFileDialog = false;
327-
// The following line specifies an absolute path but
328-
// only the name 'Sample.pdf' is used in WASM browsers
329-
DWObject.SaveAllAsPDF("D:\\Sample.pdf",
330-
function() {
331-
console.log('Successful!');
332-
},
333-
function(errCode, errString) {
334-
console.log(errString);
335-
}
336-
);
337-
```
338-
339313
### Save multiple files to the same location
340314

341315
If you want the user to choose a file path once and then save multiple images to that location, you can do so via the [ `OnGetFilePath` ]({{site.info}}api/WebTwain_IO.html#ongetfilepath) event.
@@ -370,6 +344,26 @@ DWObject.SaveAsJPEG("Sample.jpg", 0,
370344
);
371345
```
372346

347+
### Save in [WASM mode]({{site.indepth}}features/initialize.html?ver=latest#webassembly-edition)
348+
349+
In [WASM mode]({{site.indepth}}features/initialize.html?ver=latest#webassembly-edition), `DWT` runs its entire operations within desktop/mobile browsers. As a result, files are always saved in the system's Downloads folder by default, regardless of the absolute path specified. And the API [ `IfShowFileDialog` ]({{site.info}}api/WebTwain_IO.html#ifshowfiledialog) has no effect in WASM mode.
350+
351+
``` javascript
352+
// The following line will be ignored and
353+
// no file dialog will be shown in WASM mode
354+
DWObject.IfShowFileDialog = true;
355+
// The absolute path specified will be ignored and
356+
// the file 'Sample.pdf'is saved to the Downloads folder
357+
DWObject.SaveAllAsPDF("D:\\Sample.pdf",
358+
function() {
359+
console.log('Successful!');
360+
},
361+
function(errCode, errString) {
362+
console.log(errString);
363+
}
364+
);
365+
```
366+
373367
## Convert
374368

375369
In some cases, you want to process the data yourself and want to extract it from the `DWT` buffer. `DWT` offers two approaches.

0 commit comments

Comments
 (0)