⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<RootNamespace>Convert_RTF_String_to_HTML_String</RootNamespace>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Syncfusion.DocIO.Net.Core" Version="*" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
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)
{
var 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();
var htmlString = Encoding.ASCII.GetString(ms.ToArray());
ms.Close();
}
}
}
Loading