Created
March 15, 2023 16:54
-
-
Save bjoerntx/b55b2405a4dead35d637ca00bfe20c4d 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 Create(FormData data) { | |
SignData signData = new SignData(); | |
byte[] document; | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) { | |
tx.Create(); | |
tx.Load("App_Data/vaccination_form.tx", TXTextControl.StreamType.InternalUnicodeFormat); | |
using (TXTextControl.DocumentServer.MailMerge mm = new TXTextControl.DocumentServer.MailMerge()) { | |
mm.TextComponent = tx; | |
mm.FormFieldMergeType = TXTextControl.DocumentServer.FormFieldMergeType.Preselect; | |
mm.RemoveEmptyFields = false; | |
// pre-select form fields with known data and merge | |
// data into merge fields | |
mm.MergeObject(data); | |
} | |
tx.Save(out document, TXTextControl.BinaryStreamType.InternalUnicodeFormat); | |
} | |
signData.document = document; | |
signData.formData = data; | |
return View(signData); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment