RtfPipe

repository·master·Indexed 41 days ago

https://github.com/erdomke/rtfpipe

A .NET library for parsing Rich Text Format (RTF) streams and converting them into HTML. It supports core features from the RTF Specification 1.9.1, including character formatting, tables, lists, hyperlinks, and pictures. Compatible with .NET 3.5+ and .NET Standard 2.0+.

Tokens
351
Snippets
2
Records
4
Agent score
50%

What's inside RtfPipe

  1. Convert RTF to HTML using Rtf.ToHtml

    master

    Use the Rtf.ToHtml method to convert an RTF string into an HTML string.

    Important for .NET Core users:

    1. You must include the System.Text.Encoding.CodePages NuGet package.
    2. You must call Encoding.RegisterProvider(CodePagesEncodingProvider.Instance); before calling any RtfPipe functions to ensure proper encoding support.
    #if NETCORE
      // Add a reference to the NuGet package System.Text.Encoding.CodePages for .Net core only
      Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
    #endif
    var html = Rtf.ToHtml(rtf);
  2. Supported RTF features in RtfPipe

    master

    RtfPipe attempts to support core features from the RTF Specification 1.9.1, including:

    • Character formatting (bold, italics, color, etc.)
    • Tables (including nested tables)
    • Lists
    • Hyperlinks
    • Pictures
    • Heading levels
    • HTML encapsulation (e.g., as performed by Outlook)

    Note: For highly complex documents, the visual output may differ from professional RTF readers like MS Word.