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: ej2-asp-core-mvc/document-editor/export.md
+94-5Lines changed: 94 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -9,16 +9,16 @@ documentation: ug
9
9
---
10
10
11
11
12
-
# Export in Document Editor Component
12
+
# Export in Document Editor Component
13
13
14
14
Document editor exports the document into various known file formats in client-side such as Microsoft Word document (.docx), text document (.txt), and its own format called **Syncfusion Document Text (.sfdt)**.
15
15
16
16
We are providing two types of save APIs as mentioned below.
17
17
18
-
|API name|Purpose|
19
-
|--------|---------|
20
-
|save(filename,FormatType):void<br>FormatType: Sfdt or Docx or Txt|Creates the document with specified file name and format type. Then, the created file is downloaded in the client browser by default.|
21
-
|saveAsBlob(FormatType):Blob|Creates the document in specified format type and returns the created document as Blob.<br>This blob can be uploaded to your required server, database, or file path.|
18
+
|API name|Purpose|Code Snippet for Document Editor|Code Snippet for Document Editor Container|
19
+
|--------|---------|----------|----------|
20
+
|save(filename,FormatType):void<br>FormatType: Sfdt or Docx or Txt|Creates the document with specified file name and format type. Then, the created file is downloaded in the client browser by default.|documenteditor.save('sample', 'Docx')|container.documentEditor.save('sample', 'Docx')|
21
+
|saveAsBlob(FormatType):Blob|Creates the document in specified format type and returns the created document as Blob.<br>This blob can be uploaded to your required server, database, or file path.|documenteditor.saveAsBlob('Docx')|container.documentEditor.saveAsBlob('Docx')|
22
22
23
23
## Sfdt export
24
24
@@ -35,6 +35,15 @@ The following example shows how to export documents in document editor as Syncfu
35
35
{% endhighlight %}
36
36
{% endtabs %}
37
37
38
+
{% tabs %}
39
+
{% highlight cshtml tabtitle="CSHTML" %}
40
+
{% include code-snippet/document-editor-container/export-container-sfdt/tagHelper %}
41
+
{% endhighlight %}
42
+
{% highlight c# tabtitle="Document-editor.cs" %}
43
+
{% include code-snippet/document-editor-container/export-container-sfdt/document-editor.cs %}
@@ -47,6 +56,15 @@ The following example shows how to export documents in document editor as Syncfu
47
56
{% endtabs %}
48
57
{% endif %}
49
58
59
+
{% tabs %}
60
+
{% highlight razor tabtitle="CSHTML" %}
61
+
{% include code-snippet/document-editor-container/export-container-sfdt/razor %}
62
+
{% endhighlight %}
63
+
{% highlight c# tabtitle="Document-editor.cs" %}
64
+
{% include code-snippet/document-editor-container/export-container-sfdt/document-editor.cs %}
65
+
{% endhighlight %}
66
+
{% endtabs %}
67
+
{% endif %}
50
68
51
69
52
70
N>To enable Sfdt export for a document editor instance, set [`enableSfdtExport`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DocumentEditor.DocumentEditor.html#Syncfusion_EJ2_DocumentEditor_DocumentEditor_EnableSfdtExport) to true.
@@ -66,6 +84,15 @@ The following example shows how to export the document as Word document (.docx).
66
84
{% endhighlight %}
67
85
{% endtabs %}
68
86
87
+
{% tabs %}
88
+
{% highlight cshtml tabtitle="CSHTML" %}
89
+
{% include code-snippet/document-editor-container/export-container-docx/tagHelper %}
90
+
{% endhighlight %}
91
+
{% highlight c# tabtitle="Document-editor.cs" %}
92
+
{% include code-snippet/document-editor-container/export-container-docx/document-editor.cs %}
@@ -78,6 +105,15 @@ The following example shows how to export the document as Word document (.docx).
78
105
{% endtabs %}
79
106
{% endif %}
80
107
108
+
{% tabs %}
109
+
{% highlight razor tabtitle="CSHTML" %}
110
+
{% include code-snippet/document-editor-container/export-container-docx/razor %}
111
+
{% endhighlight %}
112
+
{% highlight c# tabtitle="Document-editor.cs" %}
113
+
{% include code-snippet/document-editor-container/export-container-docx/document-editor.cs %}
114
+
{% endhighlight %}
115
+
{% endtabs %}
116
+
{% endif %}
81
117
82
118
83
119
N>To enable word export for a document editor instance, set [`enableWordExport`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DocumentEditor.DocumentEditor.html#Syncfusion_EJ2_DocumentEditor_DocumentEditor_EnableWordExport) to true.
@@ -99,6 +135,15 @@ The following example shows how to export the document as Word Template (.dotx).
99
135
{% endhighlight %}
100
136
{% endtabs %}
101
137
138
+
{% tabs %}
139
+
{% highlight cshtml tabtitle="CSHTML" %}
140
+
{% include code-snippet/document-editor-container/export-container-dotx/tagHelper %}
141
+
{% endhighlight %}
142
+
{% highlight c# tabtitle="Document-editor.cs" %}
143
+
{% include code-snippet/document-editor-container/export-container-dotx/document-editor.cs %}
@@ -138,6 +202,16 @@ The following example shows how to export document as text document (.txt).
138
202
{% endtabs %}
139
203
{% endif %}
140
204
205
+
{% tabs %}
206
+
{% highlight razor tabtitle="CSHTML" %}
207
+
{% include code-snippet/document-editor-container/export-container-txt/razor %}
208
+
{% endhighlight %}
209
+
{% highlight c# tabtitle="Document-editor.cs" %}
210
+
{% include code-snippet/document-editor-container/export-container-txt/document-editor.cs %}
211
+
{% endhighlight %}
212
+
{% endtabs %}
213
+
{% endif %}
214
+
141
215
142
216
143
217
N>To enable text export for a document editor instance, set [`enableTextExport`](https://help.syncfusion.com/cr/aspnetcore-js2/Syncfusion.EJ2.DocumentEditor.DocumentEditor.html#Syncfusion_EJ2_DocumentEditor_DocumentEditor_EnableTextExport) to true.
@@ -155,6 +229,13 @@ Document editor also supports API to store the document into a blob.
155
229
{% highlight c# tabtitle="Export-blob.cs" %}
156
230
{% endhighlight %}{% endtabs %}
157
231
232
+
{% tabs %}
233
+
{% highlight cshtml tabtitle="CSHTML" %}
234
+
{% include code-snippet/document-editor-container/export-container-blob/tagHelper %}
@@ -165,6 +246,14 @@ Document editor also supports API to store the document into a blob.
165
246
{% endhighlight %}{% endtabs %}
166
247
{% endif %}
167
248
249
+
{% tabs %}
250
+
{% highlight razor tabtitle="CSHTML" %}
251
+
{% include code-snippet/document-editor-container/export-container-blob/razor %}
252
+
{% endhighlight %}
253
+
{% highlight c# tabtitle="Export-blob.cs" %}
254
+
{% endhighlight %}{% endtabs %}
255
+
{% endif %}
256
+
168
257
169
258
170
259
For instance, to export the document as Rich Text Format file, implement an ASP.NET MVC web API controller using DocIO library by passing the DOCX blob.
0 commit comments