diff --git a/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String.sln b/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String.sln new file mode 100644 index 00000000..52b87df9 --- /dev/null +++ b/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.14.36908.2 d17.14 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Convert-RTF-String-to-HTML-String", "Convert-RTF-String-to-HTML-String\Convert-RTF-String-to-HTML-String.csproj", "{850C464A-0682-420A-BA3B-65B41841A56C}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {850C464A-0682-420A-BA3B-65B41841A56C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {850C464A-0682-420A-BA3B-65B41841A56C}.Debug|Any CPU.Build.0 = Debug|Any CPU + {850C464A-0682-420A-BA3B-65B41841A56C}.Release|Any CPU.ActiveCfg = Release|Any CPU + {850C464A-0682-420A-BA3B-65B41841A56C}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {411E7CA8-6B93-4CB8-B1C6-60E844A154A0} + EndGlobalSection +EndGlobal diff --git a/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String/Convert-RTF-String-to-HTML-String.csproj b/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String/Convert-RTF-String-to-HTML-String.csproj new file mode 100644 index 00000000..28a79cf4 --- /dev/null +++ b/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String/Convert-RTF-String-to-HTML-String.csproj @@ -0,0 +1,15 @@ + + + + Exe + net8.0 + Convert_RTF_String_to_HTML_String + enable + enable + + + + + + + diff --git a/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String/Program.cs b/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String/Program.cs new file mode 100644 index 00000000..b4bca1e5 --- /dev/null +++ b/RTF-conversions/Convert-RTF-String-to-HTML-String/.NET/Convert-RTF-String-to-HTML-String/Program.cs @@ -0,0 +1,25 @@ +using Syncfusion.DocIO; +using Syncfusion.DocIO.DLS; +using System.Text; + +namespace Convert_RTF_String_To_HTML_String +{ + public class Program + { + public static void Main(string[] args) + { + string rtfString = @"{\rtf1\ansi\deff0 {\fonttbl {\f0 Times New Roman;}}\f0\fs60 Hello World!}"; + byte[] bytes = Encoding.ASCII.GetBytes(rtfString); + MemoryStream streamRTF = new MemoryStream(bytes); + WordDocument document = new WordDocument(streamRTF, FormatType.Rtf); + MemoryStream ms = new MemoryStream(); + document.Save(ms, FormatType.Html); + document.Close(); + ms.Position = 0; + streamRTF.Close(); + string htmlString = Encoding.ASCII.GetString(ms.ToArray()); + Console.WriteLine(htmlString); + ms.Close(); + } + } +} \ No newline at end of file