Created
November 12, 2024 17:49
-
-
Save bjoerntx/74d0e9c53a783a95895f010511dfd733 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
using (ServerTextControl tx = new ServerTextControl()) { | |
tx.Create(); | |
tx.Load("patient_history.tx", StreamType.InternalUnicodeFormat); | |
using (MailMerge mailMerge = new MailMerge()) { | |
mailMerge.TextComponent = tx; | |
if (flatten == false) | |
mailMerge.FormFieldMergeType = FormFieldMergeType.Preselect; | |
else | |
mailMerge.FormFieldMergeType = FormFieldMergeType.Replace; | |
mailMerge.RemoveEmptyBlocks = false; | |
string jsonData = System.IO.File.ReadAllText("patient-data.json"); | |
mailMerge.MergeJsonData(jsonData); | |
} | |
// export to PDF | |
tx.Save("results.pdf", StreamType.InternalUnicodeFormat); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment