A .NET library for parsing Rich Text Format (RTF) streams and converting them to HTML.
Get Started
| Product | Versions |
|---|---|
| .NET | |
| Other |
README
SharpRtfConvert
SharpRtfConvert is a .NET library for parsing Rich Text Format (RTF) streams and converting them to HTML. While initially adapted from the work started by Jani Giannoudis, it has been completely rewritten to support more features. When combined with the BracketPipe library, this library can also be used to convert RTF streams to various text format such as Markdown and Textile.
This is a fork from Elem.RtfPipe by elemdiscovery, from RtfPipe by cezarypiatek, from RtfPipe by erdomke.
| Description | Value |
|---|---|
| License | The MIT License (MIT) |
| Documentation | http://jeremyansel.github.io/SharpRtfConvert |
| Source code | https://github.com/JeremyAnsel/SharpRtfConvert |
| Nuget | https://www.nuget.org/packages/SharpRtfConvert |
| Build | https://ci.appveyor.com/project/JeremyAnsel/sharprtfconvert/branch/main |
Usage
Below is a simple example of converting an RTF string to an HTML string.
var html = Rtf.ToHtml(rtf);
RTF Support
This library attempts to support the core RTF features documented in the RTF Specification 1.9.1. These features include:
- Character formatting (bold, italics, color, ...)
- Tables (including nested tables, rows and columns merge)
- Lists
- Hyperlinks
- Pictures
- Heading levels
- HTML encapsulation (e.g. as performed by Outlook)
With that said, there are numerous cases for non-trivial documents where the library will not produce the "correct" visual representation when compared to other RTF readers (such as MS Word).
Downloads by Version
Similar & Alternative Packages
Hand-picked matching NuGet libraries based on tags & ecosystem
Depended On By
Find packages that declare this package as a dependency. NuGet does not provide a reverse-dependency endpoint, so candidates are checked on demand.
Adoption Assessment
Assess this package against its supported frameworks, license, maintenance signals and dependency graph before making it a project standard.
Related Guides & Workflows
Learn how to evaluate, integrate, or audit this package in your .NET project.