如何在 C# 中手动将大型 RTF 字符串转换为 HTML 字符串?
How can I convert large RTF string to HTML string manually in C#?
我从文档中读取了很大的 RTF 字符串,我需要在 ASP.NET (.cshtml) 页面上显示它。在显示之前,如何在不使用任何 nuget 包或 class 库的情况下手动将其转换为 HTML?
在 C#/.NET 中没有读取 RTF 文档的内置方法。
如果您不能(或不想)使用任何库,您唯一能做的就是实现 RTF specification, and output html based on the resulting parsed document. (But I'd just use a library, there's one doing exactly what you want: https://www.nuget.org/packages/RtfPipe/)
我从文档中读取了很大的 RTF 字符串,我需要在 ASP.NET (.cshtml) 页面上显示它。在显示之前,如何在不使用任何 nuget 包或 class 库的情况下手动将其转换为 HTML?
在 C#/.NET 中没有读取 RTF 文档的内置方法。
如果您不能(或不想)使用任何库,您唯一能做的就是实现 RTF specification, and output html based on the resulting parsed document. (But I'd just use a library, there's one doing exactly what you want: https://www.nuget.org/packages/RtfPipe/)