Skip to content

Instantly share code, notes, and snippets.

@bjoerntx
Created December 22, 2022 09:53
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/c7aaee7cc18c48d7738592958508b4ef to your computer and use it in GitHub Desktop.
Save bjoerntx/c7aaee7cc18c48d7738592958508b4ef to your computer and use it in GitHub Desktop.
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) {
tx.Create();
tx.Load("template.tx", TXTextControl.StreamType.InternalUnicodeFormat);
using (TXTextControl.DocumentServer.MailMerge mailMerge = new TXTextControl.DocumentServer.MailMerge()) {
mailMerge.TextComponent = tx;
mailMerge.SearchPath = Application.StartupPath;
var jsonData = System.IO.File.ReadAllText("data.json");
mailMerge.MergeJsonData(jsonData);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment