Plugin.RTFView
1.0.0
dotnet add package Plugin.RTFView --version 1.0.0
NuGet\Install-Package Plugin.RTFView -Version 1.0.0
<PackageReference Include="Plugin.RTFView" Version="1.0.0" />
<PackageVersion Include="Plugin.RTFView" Version="1.0.0" />
<PackageReference Include="Plugin.RTFView" />
paket add Plugin.RTFView --version 1.0.0
#r "nuget: Plugin.RTFView, 1.0.0"
#:package Plugin.RTFView@1.0.0
#addin nuget:?package=Plugin.RTFView&version=1.0.0
#tool nuget:?package=Plugin.RTFView&version=1.0.0
Plugin.RTFView
A cross-platform .NET MAUI control that renders Rich Text Format (RTF) content. It maps onto each platform's native text rendering, so RTF looks the way the platform intends:
| Platform | Backing view | RTF rendering |
|---|---|---|
| iOS / Mac Catalyst | UITextView |
Native NSAttributedString RTF parser |
| Windows | RichEditBox (read-only) |
Native Document.SetText(FormatRtf, …) |
| Android | TextView |
Built-in RTF → Spanned parser (no native RTF support) |
Install
dotnet add package Plugin.RTFView
Targets net10.0-android, net10.0-ios, net10.0-maccatalyst, and net10.0-windows10.0.19041.0.
Setup
Register the handler in MauiProgram.cs:
using Plugin.RTFView;
public static MauiApp CreateMauiApp()
{
var builder = MauiApp.CreateBuilder();
builder
.UseMauiApp<App>()
.UseRtfView(); // 👈 registers the RtfView handler
return builder.Build();
}
Usage
XAML
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:rtf="clr-namespace:Plugin.RTFView;assembly=Plugin.RTFView"
x:Class="MyApp.MainPage">
<rtf:RtfView RtfSource="{Binding Document}" />
</ContentPage>
C#
using Plugin.RTFView;
var view = new RtfView
{
RtfSource = @"{\rtf1\ansi {\colortbl;\red200\green0\blue0;}" +
@"\b\fs28\cf1 Hello\b0 \i world\i0 !\par}"
};
API
| Member | Type | Description |
|---|---|---|
RtfView |
View |
The control. |
RtfView.RtfSource |
string? |
The raw RTF markup to render. Bindable (RtfSourceProperty). |
RtfViewBuilderExtensions.UseRtfView() |
extension | Registers the handler on the MauiAppBuilder. |
Setting RtfSource to null or an empty string clears the view. Malformed RTF is handled gracefully — the control logs a diagnostic and clears rather than throwing.
Supported RTF features
The native platforms (iOS/Mac/Windows) support the full breadth of their respective RTF engines. The Android parser is a pragmatic, dependency-free subset covering the common cases:
- Groups
{ }with inherited state - Bold, italic, and underline (
\b \i \ul+ their0/noneforms,\plain) - Foreground colour (
\colortbl+\cf) - Background / highlight colour (
\cb,\highlight) - Font family (
\fonttbl+\f) - Font size (
\fs, half-points → density-independent pixels) - Paragraph alignment (
\ql \qc \qr \qj,\pard) - Paragraph and line breaks (
\par,\line), tabs (\tab) - Escaped characters (
\\ \{ \}),\'xxhex bytes, and\uNUnicode with\ucNfallback skipping
Not supported on Android
These do not map cleanly onto a TextView / Spanned model and degrade to plain (unstyled / unaligned) text:
- Lists, tables
- Embedded images / objects (
\pict,\object) - Indents, line spacing, tab stops
- Superscript / subscript
Building from source
dotnet build # all platforms (Windows TFM only builds on Windows)
dotnet build -f net10.0-android # a single target
dotnet pack -c Release # produce the NuGet package
Note: the
net10.0-windowstarget only builds on a Windows host. The Windows rendering path should be compiled and smoke-tested on Windows before release.
License
DILLIGAF License v1.0 © 2026 Paul F. Johnson.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0-android36.0 is compatible. net10.0-ios26.0 is compatible. net10.0-maccatalyst26.0 is compatible. net10.0-windows10.0.19041 is compatible. |
-
net10.0-android36.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-ios26.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-maccatalyst26.0
- Microsoft.Maui.Controls (>= 10.0.20)
-
net10.0-windows10.0.19041
- Microsoft.Maui.Controls (>= 10.0.20)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0 | 110 | 6/11/2026 |