Skip to content

Instantly share code, notes, and snippets.

View bjoerntx's full-sized avatar
👨‍💻
Building web apps

Bjoern Meyer bjoerntx

👨‍💻
Building web apps
View GitHub Profile
string markdown = tx.SaveMarkdown();
using var tx = new ServerTextControl();
tx.Create();
tx.LoadMarkdown("# Quarterly Report");
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Invoice Summary</title>
</head>
<body>
<h1>Invoice #TX-2042</h1>
<p>Prepared for <strong>Contoso Publishing</strong> on <em>June 11, 2026</em>.</p>
var html = File.ReadAllText(htmlFile);
var markdown =
ConvertHtmlToMarkdownWithTextControl(html).Trim()
+ Environment.NewLine;
var outputFile = Path.Combine(
outputDirectory,
$"{Path.GetFileNameWithoutExtension(htmlFile)}.md");
var htmlFiles = Directory
.EnumerateFiles(inputDirectory, "*.html", SearchOption.TopDirectoryOnly)
.OrderBy(file => file, StringComparer.OrdinalIgnoreCase)
.ToArray();
tx.LoadMarkdown("# Hello from Markdown");
string markdown = tx.SaveMarkdown();
using var tx = new ServerTextControl();
if (!tx.Create())
{
throw new InvalidOperationException(
"Could not create the TX Text Control ServerTextControl instance.");
}
tx.Load(html, StringStreamType.HTMLFormat);
using System.Security.Cryptography.X509Certificates;
using TXTextControl;
using var tx = new ServerTextControl();
tx.Create();
tx.Load(
"signature.tx",
StreamType.InternalUnicodeFormat);
using System.Drawing;
using System.Security.Cryptography.X509Certificates;
using TXTextControl;
using var tx = new ServerTextControl();
tx.Create();
var signatureField = new SignatureField(
new Size(2000, 2000),
using System.Security.Cryptography.X509Certificates;
using TXTextControl;
using var tx = new ServerTextControl();
tx.Create();
tx.Text = "This is a signed PDF document.";
var certificate = new X509Certificate2(