Created
February 21, 2022 21:33
-
-
Save bjoerntx/6175249cfc08c03e1cd1d5bc19b771f3 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
HealthcareForm data = new HealthcareForm() { | |
insurance_date = new DateTime(2020,1,1), | |
insurance_name = "Health Providers", | |
insurance_check = true, | |
insurance_state = "Georgia", | |
notes = "Thanks for your business." | |
}; | |
using (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) { | |
tx.Create(); | |
tx.Load("App_Data/health_form.tx", TXTextControl.StreamType.InternalUnicodeFormat); | |
using (MailMerge mm = new MailMerge()) { | |
mm.TextComponent = tx; | |
mm.FormFieldMergeType = FormFieldMergeType.Replace; | |
mm.MergeObject(data); | |
} | |
// save document as PDF | |
byte[] document; | |
tx.Save(out document, TXTextControl.BinaryStreamType.AdobePDF); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment