Created
March 24, 2025 18:15
-
-
Save bjoerntx/a7b28a983e9ee408ead67e65e3e7e2e6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@page "/" | |
@rendermode InteractiveServer | |
<PageTitle>Home</PageTitle> | |
<h1>Hello, Blazor!</h1> | |
<TXTextControl.Web.Blazor.DocumentEditor.DocumentEditor | |
@ref="_documentEditor" Width="800px" Height="500px" /> | |
<button class="btn btn-primary mt-5" @onclick="ButtonLoad"> | |
Load Document | |
</button> | |
@code { | |
private TXTextControl.Web.Blazor.DocumentEditor.DocumentEditor _documentEditor; | |
private async Task ButtonLoad() | |
{ | |
try | |
{ | |
await _documentEditor.LoadDocumentAsync("Documents/template.docx", | |
TXTextControl.Web.StreamType.WordprocessingML); | |
} | |
catch (Exception ex) | |
{ | |
Console.Error.WriteLine($"Error loading document: {ex.Message}"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment