Last active
February 10, 2021 16:08
-
-
Save bjoerntx/dd0ede2d9820a0addf1ec051151b66fb 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 (TXTextControl.ServerTextControl tx = new TXTextControl.ServerTextControl()) { | |
tx.Create(); | |
tx.Selection.FontSize = 800; | |
tx.Selection.Text = "Sample Form\r\n\r\n"; | |
tx.Selection.FontSize = 400; | |
tx.Selection.Text = "Company name:\r\n"; | |
// add a text form field | |
TXTextControl.TextFormField textFormField = new TXTextControl.TextFormField(1000); | |
textFormField.Name = "company_name"; | |
textFormField.Text = "Text Control, LLC"; | |
tx.FormFields.Add(textFormField); | |
tx.Selection.Text = "\r\n\r\nCountry:\r\n"; | |
// add a text form field | |
TXTextControl.SelectionFormField selectionFormField = new TXTextControl.SelectionFormField(1000); | |
selectionFormField.Name = "company_country"; | |
selectionFormField.Items = new string[] { "United States", "Germany", "Italy" }; | |
selectionFormField.SelectedIndex = 0; | |
tx.FormFields.Add(selectionFormField); | |
// export the document as PDF | |
tx.Save("results.pdf", TXTextControl.StreamType.AdobePDF); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment