Esta página aún no está traducida. Se muestra en inglés.
Este capítulo está disponible en inglés y búlgaro.
RayCraft Write is a WYSIWYG rich text editor for Blazor Server on .NET 10. It gives your users a familiar word-processor surface for articles, e-mails, product descriptions and documents, and gives you clean, safe HTML, Markdown, JSON or Word files on the server.
What you get
- The editor itself: JavaScript (ES modules, no libraries, no build step) in one Razor class library, package
RayCraft.Write. - A C# side that does everything which needs a server: filtering and cleaning HTML, conversion to Markdown, JSON and e-mail HTML, Word export and import, a library of files, revisions, comments and accessibility checks.
- Small interfaces for everything you may want to replace: file storage, templates, spell checking, link previews, people, revisions, comments and collaboration.
- Ten interface languages.
The package depends only on the shared framework Microsoft.AspNetCore.App. It does not need any other RayCraft package.
Five minutes
- Install the package from the RayCraft feed (Installation).
- Register the services and raise the SignalR message limit:
builder.Services.AddRazorComponents()
.AddInteractiveServerComponents()
.AddHubOptions(o => o.MaximumReceiveMessageSize = 20 * 1024 * 1024);
builder.Services.AddRte(); - Use the component on an interactive page:
@page "/article"
@rendermode InteractiveServer
<RichTextEditor @bind-Value="html" DocumentId="article-42" />
@code {
string? html = "<p>Hello</p>";
} - Link the style sheet in the
<head>ofApp.razor(the editor loads it by itself too, but this avoids a flash of unstyled content):
<link rel="stylesheet" href="_content/Rte/css/rte.css" /> The bound Value is always filtered on the server before your code sees it (Security).
How the parts fit
| Part | Where | What it does |
|---|---|---|
RichTextEditor | component | shows the editor, binds Value, exposes methods |
RteOptions | parameter Options | everything the user sees: toolbar, modes, limits, language |
AddRte(...) | Program.cs | server settings and the default services |
Rte.Processing | static classes | the same conversions without the editor |
Rte.Export | BasicDocxExporter, BasicDocxImporter | Word files |
| JavaScript API | window.Rte, plugins | extend the editor in the browser |
Requirements and limits
- .NET 10, Blazor Server with interactive server rendering.
- A current Chromium-based browser is the tested target. Firefox, Safari, touch devices, IME composition and real speech devices were not tested yet.
- Equations and diagrams are drawn only if KaTeX or Mermaid is on the page. Concurrent editing needs a CRDT that you connect. PDF is the print dialog of the browser. See Export and import.
Where to go next
Installation · Configuration · Features · Menus and keys · Languages · Export and import · Security · FAQ · License
¿Listo para probar RayCraft Write?
Empieza la prueba de 14 días, sin necesidad de tarjeta.
Empezar la prueba de 14 días