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
Copy file name to clipboardExpand all lines: specs/ProgrammaticSaveAs.md
+33-18Lines changed: 33 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,15 +3,27 @@ Programmatic Save As API
3
3
4
4
# Background
5
5
6
-
The context menu has the "Save as" item to manually save the html page, image, pdf, or other content through a save as dialog. We provide more flexiable ways to do the save as programmatically in WebView2. You can bring up the default save as dialog easily. And you will be able to block default dialog, save the content silently, by providing the path and save as type programmatically or even build your own save as UI.
6
+
The context menu has the "Save as" item to manually save the html page, image,
7
+
pdf, or other content through a save as dialog. We provide more flexiable ways
8
+
to do the save as programmatically in WebView2. You can bring up the default
9
+
save as dialog easily. And you will be able to block default dialog, save the
10
+
content silently, by providing the path and save as type programmatically or
11
+
even build your own save as UI.
7
12
8
13
In this document we describe the API. We'd appreciate your feedback.
9
14
10
15
# Description
11
16
12
-
We propose the `SaveContentAs` method WebView2, which allows you to trigger the save as programmatically. By using this method alone, the system default will popup.
17
+
We propose the `SaveContentAs` method WebView2, which allows you to trigger
18
+
the save as programmatically. By using this method alone, the system default
19
+
will popup.
13
20
14
-
Additionally, we propose the `SaveAsRequestedEvent`. You can register this event to block the default dialog and use the `SaveAsRequestedEventArgs` instead, to set your perferred save as path, save as type, and depulicate file replacement rule. In your clinet app, you can design your own UI to input these parameters. For html page, we support 3 save as types: HTML_ONLY, SINGLE_FILE and COMPLETE. For non-html page, the type is been set as DEFAULT, which will save the content as it is. This API also provides default values for all parameters, if you don't want to input anything.
21
+
Additionally, we propose the `SaveAsRequested` event. You can register this
22
+
event to block the default dialog and use the `SaveAsRequestedEventArgs`
23
+
instead, to set your preferred save as path, save as type, and duplicate file replacement rule. In your client app, you can design your own UI to input
24
+
these parameters. For HTML documents, we support 3 save as types: HTML_ONLY, SINGLE_FILE and COMPLETE. Non-HTML documents, must use DEFAULT, which will
25
+
save the content as it is. This API has default values for all parameters,
0 commit comments