Plugin.RTFView 1.0.0

dotnet add package Plugin.RTFView --version 1.0.0
                    
NuGet\Install-Package Plugin.RTFView -Version 1.0.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Plugin.RTFView" Version="1.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Plugin.RTFView" Version="1.0.0" />
                    
Directory.Packages.props
<PackageReference Include="Plugin.RTFView" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Plugin.RTFView --version 1.0.0
                    
#r "nuget: Plugin.RTFView, 1.0.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Plugin.RTFView@1.0.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Plugin.RTFView&version=1.0.0
                    
Install as a Cake Addin
#tool nuget:?package=Plugin.RTFView&version=1.0.0
                    
Install as a Cake Tool

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 + their 0 / none forms, \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 (\\ \{ \}), \'xx hex bytes, and \uN Unicode with \ucN fallback 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-windows target 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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