Last active
June 16, 2022 11:38
-
-
Save bjoerntx/301eb6654317c3ea4e81b558ffdf41e2 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
FormField[] acroForms = Forms.GetAcroFormFields("lease_agreement.pdf"); | |
foreach (FormField field in acroForms) { | |
switch (field) { | |
case FormTextField textField: | |
Console.WriteLine("Field \"{0}\" extracted: {1}", | |
textField.FieldName, | |
textField.Value); | |
break; | |
case FormCheckBox checkBoxField: | |
Console.WriteLine("Field \"{0}\" extracted: {1}", | |
checkBoxField.FieldName, | |
checkBoxField.IsChecked.ToString()); | |
break; | |
case FormComboBox comboBoxField: | |
Console.WriteLine("Field \"{0}\" extracted. Selected value: {1}", | |
comboBoxField.FieldName, | |
comboBoxField.Value); | |
foreach (var item in comboBoxField.Options) { | |
Console.WriteLine(" -> Option: {0}", item); | |
} | |
break; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment