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
public static List<string> ExtractSentences(string input)
{
List<string> sentences = new List<string>();
// Use regular expression to split the input string into sentences but keep white spaces
string pattern = @"([.!?])";
// split the input string into sentences with the delimiters
string[] splitSentences = Regex.Split(input, pattern);
DocumentComparison dc = new DocumentComparison(textControl1, textControl2);
public IActionResult Index()
{
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
tx.Load("App_Data/gpay_application.tx", TXTextControl.StreamType.InternalUnicodeFormat);
var jsonData = System.IO.File.ReadAllText("App_Data/data.json");
using (MailMerge mm = new MailMerge())
ublic IActionResult Index()
{
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
tx.Load("App_Data/gpay_application.tx", TXTextControl.StreamType.InternalUnicodeFormat);
var jsonData = System.IO.File.ReadAllText("App_Data/data.json");
using (MailMerge mm = new MailMerge())
[HttpPost]
public string CreatePdf([FromBody] TXTextControl.Web.MVC.DocumentViewer.Models.SignatureData signatureData)
{
byte[] bPDF;
// create temporary ServerTextControl
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
[HttpPost]
public string CreatePdf([FromBody] TXTextControl.Web.MVC.DocumentViewer.Models.SignatureData signatureData)
{
byte[] bPDF;
// create temporary ServerTextControl
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
[
{
"business": {
"dba": {
"name": "My Business",
"street": "123 Main St",
"city": "Anytown",
"state": "North Carolina",
"zip": "12345",
"phone": "555-555-5555",
public IActionResult Index()
{
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl())
{
tx.Create();
tx.Load("App_Data/gpay_application.tx", TXTextControl.StreamType.InternalUnicodeFormat);
var jsonData = System.IO.File.ReadAllText("App_Data/data.json");
using (MailMerge mm = new MailMerge())
string jsonData = File.ReadAllText("data.json");
using (MailMerge mailMerge = new MailMerge())
{
mailMerge.TextComponent = textControl1;
mailMerge.MergeJsonData(jsonData);
}
[
{
"invoice": {
"company": "Company Name",
"address": "1234 Street Name",
"svgimagedata": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"346.667\" height=\"36.817\" xml:space=\"preserve\"><style>.s1{fill:#102b66}.s2{fill:#9d9d9c}</style><switch><g><path class=\"s1\" d=\"M45.563.672h4.286l9.583 14.545L69.1.672h4.201L61.449 18.073l12.189 17.653h-4.372l-9.834-14.88-9.921 14.88h-4.285l12.188-17.653zM10.424 4.12v31.606H6.977V4.12H0V.672h17.486V4.12zM25.892 19.84v12.524h14.794v3.361h-18.24V.672h18.24v3.45H25.892v12.27h14.794v3.448zM85.658 4.12v31.606h-3.447V4.12H75.15V.672h17.484V4.12zM174.93.672h10.847l12.858 20.176V.672h8.323v35.223h-8.742L183.253 11.77v24.125h-8.323zM241.843.672v6.809H230.83v28.414h-9.079V7.481H210.74V.672zM260 7.231c-.588-.085-1.261-.085-2.017-.085h-3.279v9.5h2.775c.925 0 1.765 0 2.521-.087v7.988l-1.176-1.598h-4.121v12.945h-9.078V.672h14.374v6.559zm5.382 4.202c0-.841-.169-1.598-.504-2.271-.422-.588-1.012-1.092-1.933-1.428-.589-.252-1.262-.421-2.106-.504h-.838V.672h.