/
Program.cs
30 lines (25 loc) · 1020 Bytes
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
using DevExpress.Pdf;
namespace GetRadioGroupCheckedValues
{
class Program
{
static void Main(string[] args)
{
// Load a document with an interactive form.
PdfDocumentProcessor processor = new PdfDocumentProcessor();
processor.LoadDocument(@"DocumentToFill.pdf");
// Retrieve the form field facade:
PdfDocumentFacade documentFacade = processor.DocumentFacade;
PdfAcroFormFacade acroFormFacade = documentFacade.AcroForm;
// Specify a checked appearance name for the Female radio button:
PdfRadioGroupFormFieldFacade genderField = acroFormFacade.GetRadioGroupFormField("Gender");
foreach (PdfFormFieldItem item in genderField.Field.Items)
{
if (item.Value == "Female")
genderField.Value = item.Value;
}
// Save the modified document.
processor.SaveDocument("..\\..\\Result.pdf");
}
}
}