diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/document-editor.cs b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/document-editor.cs new file mode 100644 index 0000000000..048a3eb88c --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/document-editor.cs @@ -0,0 +1,5 @@ +public ActionResult Default() +{ + return View(); +} + diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/razor b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/razor new file mode 100644 index 0000000000..0ef77821c6 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/razor @@ -0,0 +1,16 @@ +@Html.EJS().Button("export").Content("Export").Render() +
+ @Html.EJS().DocumentEditorContainer("container").IsReadOnly(false).EnableEditor(true).EnableSelection(true).EnableSfdtExport(true).Render() +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/tagHelper b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/tagHelper new file mode 100644 index 0000000000..076b9a70a9 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-blob/tagHelper @@ -0,0 +1,16 @@ +Export +
+ +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/document-editor.cs b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/document-editor.cs new file mode 100644 index 0000000000..048a3eb88c --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/document-editor.cs @@ -0,0 +1,5 @@ +public ActionResult Default() +{ + return View(); +} + diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/razor b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/razor new file mode 100644 index 0000000000..22378936ef --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/razor @@ -0,0 +1,16 @@ +@Html.EJS().Button("export").Content("Export").Render() +
+ @Html.EJS().DocumentEditorContainer("container").IsReadOnly(false).EnableEditor(true).EnableSelection(true).EnableSfdtExport(true).Render() +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/tagHelper b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/tagHelper new file mode 100644 index 0000000000..e5f3071471 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-docx/tagHelper @@ -0,0 +1,16 @@ +Export +
+ +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/document-editor.cs b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/document-editor.cs new file mode 100644 index 0000000000..048a3eb88c --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/document-editor.cs @@ -0,0 +1,5 @@ +public ActionResult Default() +{ + return View(); +} + diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/razor b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/razor new file mode 100644 index 0000000000..25db6655ea --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/razor @@ -0,0 +1,16 @@ +@Html.EJS().Button("export").Content("Export").Render() +
+ @Html.EJS().DocumentEditorContainer("container").IsReadOnly(false).EnableEditor(true).EnableSelection(true).EnableSfdtExport(true).Render() +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/tagHelper b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/tagHelper new file mode 100644 index 0000000000..ea814856f5 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-dotx/tagHelper @@ -0,0 +1,16 @@ +Export +
+ +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/document-editor.cs b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/document-editor.cs new file mode 100644 index 0000000000..048a3eb88c --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/document-editor.cs @@ -0,0 +1,5 @@ +public ActionResult Default() +{ + return View(); +} + diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/razor b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/razor new file mode 100644 index 0000000000..b73361aadb --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/razor @@ -0,0 +1,16 @@ +@Html.EJS().Button("export").Content("Export").Render() +
+ @Html.EJS().DocumentEditorContainer("container").IsReadOnly(false).EnableEditor(true).EnableSelection(true).EnableSfdtExport(true).Render() +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/tagHelper b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/tagHelper new file mode 100644 index 0000000000..89c62544df --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-sfdt/tagHelper @@ -0,0 +1,16 @@ +Export +
+ +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/document-editor.cs b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/document-editor.cs new file mode 100644 index 0000000000..048a3eb88c --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/document-editor.cs @@ -0,0 +1,5 @@ +public ActionResult Default() +{ + return View(); +} + diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/razor b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/razor new file mode 100644 index 0000000000..0e979b4800 --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/razor @@ -0,0 +1,16 @@ +@Html.EJS().Button("export").Content("Export").Render() +
+ @Html.EJS().DocumentEditorContainer("container").IsReadOnly(false).EnableEditor(true).EnableSelection(true).EnableSfdtExport(true).Render() +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/tagHelper b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/tagHelper new file mode 100644 index 0000000000..bc696a6b4f --- /dev/null +++ b/ej2-asp-core-mvc/code-snippet/document-editor-container/export-container-txt/tagHelper @@ -0,0 +1,16 @@ +Export +
+ +
+ + \ No newline at end of file diff --git a/ej2-asp-core-mvc/document-editor/export.md b/ej2-asp-core-mvc/document-editor/export.md index d257d4e1df..fe2d6edb10 100644 --- a/ej2-asp-core-mvc/document-editor/export.md +++ b/ej2-asp-core-mvc/document-editor/export.md @@ -9,16 +9,16 @@ documentation: ug --- -# Export in Document Editor Component +# Export in Document Editor Component 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)**. We are providing two types of save APIs as mentioned below. -|API name|Purpose| -|--------|---------| -|save(filename,FormatType):void
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.| -|saveAsBlob(FormatType):Blob|Creates the document in specified format type and returns the created document as Blob.
This blob can be uploaded to your required server, database, or file path.| +|API name|Purpose|Code Snippet for Document Editor|Code Snippet for Document Editor Container| +|--------|---------|----------|----------| +|save(filename,FormatType):void
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')| +|saveAsBlob(FormatType):Blob|Creates the document in specified format type and returns the created document as Blob.
This blob can be uploaded to your required server, database, or file path.|documenteditor.saveAsBlob('Docx')|container.documentEditor.saveAsBlob('Docx')| ## Sfdt export @@ -35,6 +35,15 @@ The following example shows how to export documents in document editor as Syncfu {% endhighlight %} {% endtabs %} +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-sfdt/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="Document-editor.cs" %} +{% include code-snippet/document-editor-container/export-container-sfdt/document-editor.cs %} +{% endhighlight %} +{% endtabs %} + {% elsif page.publishingplatform == "aspnet-mvc" %} {% tabs %} @@ -47,6 +56,15 @@ The following example shows how to export documents in document editor as Syncfu {% endtabs %} {% endif %} +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-sfdt/razor %} +{% endhighlight %} +{% highlight c# tabtitle="Document-editor.cs" %} +{% include code-snippet/document-editor-container/export-container-sfdt/document-editor.cs %} +{% endhighlight %} +{% endtabs %} +{% endif %} 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). {% endhighlight %} {% endtabs %} +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-docx/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="Document-editor.cs" %} +{% include code-snippet/document-editor-container/export-container-docx/document-editor.cs %} +{% endhighlight %} +{% endtabs %} + {% elsif page.publishingplatform == "aspnet-mvc" %} {% tabs %} @@ -78,6 +105,15 @@ The following example shows how to export the document as Word document (.docx). {% endtabs %} {% endif %} +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-docx/razor %} +{% endhighlight %} +{% highlight c# tabtitle="Document-editor.cs" %} +{% include code-snippet/document-editor-container/export-container-docx/document-editor.cs %} +{% endhighlight %} +{% endtabs %} +{% endif %} 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). {% endhighlight %} {% endtabs %} +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-dotx/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="Document-editor.cs" %} +{% include code-snippet/document-editor-container/export-container-dotx/document-editor.cs %} +{% endhighlight %} +{% endtabs %} + {% elsif page.publishingplatform == "aspnet-mvc" %} {% tabs %} @@ -111,6 +156,16 @@ The following example shows how to export the document as Word Template (.dotx). {% endtabs %} {% endif %} +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-dotx/razor %} +{% endhighlight %} +{% highlight c# tabtitle="Document-editor.cs" %} +{% include code-snippet/document-editor-container/export-container-dotx/document-editor.cs %} +{% endhighlight %} +{% endtabs %} +{% endif %} + ## Text export The following example shows how to export document as text document (.txt). @@ -126,6 +181,15 @@ The following example shows how to export document as text document (.txt). {% endhighlight %} {% endtabs %} +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-txt/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="Document-editor.cs" %} +{% include code-snippet/document-editor-container/export-container-txt/document-editor.cs %} +{% endhighlight %} +{% endtabs %} + {% elsif page.publishingplatform == "aspnet-mvc" %} {% tabs %} @@ -138,6 +202,16 @@ The following example shows how to export document as text document (.txt). {% endtabs %} {% endif %} +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-txt/razor %} +{% endhighlight %} +{% highlight c# tabtitle="Document-editor.cs" %} +{% include code-snippet/document-editor-container/export-container-txt/document-editor.cs %} +{% endhighlight %} +{% endtabs %} +{% endif %} + 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. {% highlight c# tabtitle="Export-blob.cs" %} {% endhighlight %}{% endtabs %} +{% tabs %} +{% highlight cshtml tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-blob/tagHelper %} +{% endhighlight %} +{% highlight c# tabtitle="Export-blob.cs" %} +{% endhighlight %}{% endtabs %} + {% elsif page.publishingplatform == "aspnet-mvc" %} {% tabs %} @@ -165,6 +246,14 @@ Document editor also supports API to store the document into a blob. {% endhighlight %}{% endtabs %} {% endif %} +{% tabs %} +{% highlight razor tabtitle="CSHTML" %} +{% include code-snippet/document-editor-container/export-container-blob/razor %} +{% endhighlight %} +{% highlight c# tabtitle="Export-blob.cs" %} +{% endhighlight %}{% endtabs %} +{% endif %} + 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.