Created
April 30, 2024 15:43
-
-
Save bjoerntx/d1c2828b6939a7a976bd558340ade089 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() | |
{ | |
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()) | |
{ | |
mm.TextComponent = tx; | |
mm.FormFieldMergeType = FormFieldMergeType.Preselect; | |
mm.MergeJsonData(jsonData); | |
} | |
byte[] data; | |
tx.Save(out data, TXTextControl.BinaryStreamType.InternalUnicodeFormat); | |
ViewBag.Document = Convert.ToBase64String(data); | |
} | |
return View(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment