Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created January 2, 2024 13:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bjoerntx/85f683c0c14422cf673292a6aab7bb4a to your computer and use it in GitHub Desktop.
Save bjoerntx/85f683c0c14422cf673292a6aab7bb4a to your computer and use it in GitHub Desktop.
namespace MyClassLibrary
{
public static class Class1
{
static Class1()
{
TXTextControl.ServerTextControl.EntryAssembly =
typeof(Class1).Assembly;
}
public static string GetHtml()
{
using (TXTextControl.ServerTextControl tx =
new TXTextControl.ServerTextControl())
{
tx.Create();
TXTextControl.Selection selection =
new TXTextControl.Selection();
selection.Text = "Hello, World!";
selection.Start = 0;
selection.Length = 5;
selection.Bold = true;
tx.Selection = selection;
var html = "";
tx.Save(out html, TXTextControl.StringStreamType.HTMLFormat);
return html;
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment