Skip to content

Commit d15a443

Browse files
committed
Updated Getting started Server sample
1 parent 314b5db commit d15a443

File tree

1 file changed

+23
-0
lines changed
  • Getting-Started/Blazor/Blazor-Server-app/Create-Word-document/Pages

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
@page "/DocIO"
2+
@using System.IO;
3+
@using Create_Word_document;
4+
@inject Create_Word_document.Data.WordService service
5+
@inject Microsoft.JSInterop.IJSRuntime JS
6+
7+
<h2>Syncfusion DocIO library (Essential DocIO)</h2>
8+
<p>Syncfusion DocIO library (Essential DocIO) is a Blazor DocIO library used to create, read, edit, and convert Word files in your applications without Microsoft Office dependencies.</p>
9+
<button class="btn btn-primary" @onclick="@CreateWord">Create Word</button>
10+
11+
12+
@code {
13+
MemoryStream documentStream;
14+
15+
/// <summary>
16+
/// Create and download the Word document
17+
/// </summary>
18+
protected async void CreateWord()
19+
{
20+
documentStream = service.CreateWord();
21+
await JS.SaveAs("Sample.docx", documentStream.ToArray());
22+
}
23+
}

0 commit comments

Comments
 (0)