Created
June 9, 2023 13:46
-
-
Save bjoerntx/c76ea192c4727803ebe77a0c6c45e537 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IActionResult Index() { | |
byte[] data; | |
Claim claim = new Claim() { | |
name = "Tim Typer", | |
dob = new DateTime(2010, 5, 5), | |
}; | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) { | |
tx.Create(); | |
tx.Load("App_Data/claim_form.tx", TXTextControl.StreamType.InternalUnicodeFormat); | |
using (MailMerge mailMerge = new MailMerge()) { | |
mailMerge.TextComponent = tx; | |
mailMerge.FormFieldMergeType = FormFieldMergeType.Preselect; | |
mailMerge.MergeObject(claim); | |
} | |
tx.Save(out data, TXTextControl.BinaryStreamType.InternalUnicodeFormat); | |
} | |
return View(data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment