Table of Contents

Class PdfXfaRadioButtonField

Namespace
Syncfusion.Pdf.Xfa
Assembly
Syncfusion.Pdf.Portable.dll

Represents the XFA radio button field

public class PdfXfaRadioButtonField : PdfXfaStyledField
Inheritance
PdfXfaRadioButtonField
Inherited Members

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", new SizeF(80, 20));
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", new SizeF(80, 20));
radioButtonField2.Caption.Text = "Female";
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", New SizeF(80, 20))
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", New SizeF(80, 20))
radioButtonField2.Caption.Text = "Female"
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()

Constructors

PdfXfaRadioButtonField(string, SizeF)

Initializes a new instance of the PdfXfaRadioButtonField class.

public PdfXfaRadioButtonField(string name, SizeF size)

Parameters

name string

Name of the radio button field.

size SizeF

Size of the radio button field.

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", new SizeF(80, 20));
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", new SizeF(80, 20));
radioButtonField2.Caption.Text = "Female";
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", New SizeF(80, 20))
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", New SizeF(80, 20))
radioButtonField2.Caption.Text = "Female"
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()

PdfXfaRadioButtonField(string, float, float)

Initializes a new instance of the PdfXfaRadioButtonField class.

public PdfXfaRadioButtonField(string name, float width, float height)

Parameters

name string

Name of the radio button field.

width float

Width of the radio button field.

height float

Height of the radio button field.

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", 80, 20);
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", 80, 20);
radioButtonField2.Caption.Text = "Female";
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", 80, 20)
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", 80, 20)
radioButtonField2.Caption.Text = "Female"
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()

Properties

Caption

Gets or sets the caption of the field

public PdfXfaCaption Caption { get; set; }

Property Value

PdfXfaCaption

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", new SizeF(80, 20));
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", new SizeF(80, 20));
radioButtonField2.Caption.Text = "Female";
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", New SizeF(80, 20))
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", New SizeF(80, 20))
radioButtonField2.Caption.Text = "Female"
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()

CheckedStyle

Gets or sets the checked style of the radio button

public PdfXfaCheckedStyle CheckedStyle { get; set; }

Property Value

PdfXfaCheckedStyle

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", new SizeF(80, 20));
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", new SizeF(80, 20));
radioButtonField2.Caption.Text = "Female";
//Set the checked style.
radioButtonField2.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", New SizeF(80, 20))
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", New SizeF(80, 20))
radioButtonField2.Caption.Text = "Female"
'Set the checked style.
radioButtonField2.CheckedStyle = PdfXfaCheckedStyle.Cross
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()

IsChecked

Gets or sets a value indicating whether this is checked or not.
true if checked; otherwise, false.

public bool IsChecked { get; set; }

Property Value

bool

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", new SizeF(80, 20));
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", new SizeF(80, 20));
radioButtonField2.Caption.Text = "Female";
radioButtonField2.IsChecked = true;
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", New SizeF(80, 20))
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", New SizeF(80, 20))
radioButtonField2.Caption.Text = "Female"
radioButtonField2.IsChecked = True
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()

RadioButtonAppearance

Gets or sets the appearance of the radio button

public PdfXfaCheckBoxAppearance RadioButtonAppearance { get; set; }

Property Value

PdfXfaCheckBoxAppearance

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", new SizeF(80, 20));
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", new SizeF(80, 20));
radioButtonField2.Caption.Text = "Female";
//Set the button appearance.
radioButtonField2.RadioButtonAppearance = PdfXfaCheckBoxAppearance.Square;
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", New SizeF(80, 20))
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", New SizeF(80, 20))
radioButtonField2.Caption.Text = "Female"
'Set the button appearance.
radioButtonField2.RadioButtonAppearance = PdfXfaCheckBoxAppearance.Square
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()

RadioButtonSize

Gets or sets the size of the radio button

public float RadioButtonSize { get; set; }

Property Value

float

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", new SizeF(80, 20));
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", new SizeF(80, 20));
radioButtonField2.Caption.Text = "Female";
//Set the radio button size.
radioButtonField2.RadioButtonSize = 10;
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", New SizeF(80, 20))
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", New SizeF(80, 20))
radioButtonField2.Caption.Text = "Female"
'Set the radio button size.
radioButtonField2.RadioButtonSize = 10
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()

Methods

Clone()

Creates a new object that is a copy of the current instance.

public object Clone()

Returns

object

The copy of the new object for this instance.

Examples

//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Add a new XFA page.
PdfXfaPage xfaPage = document.Pages.Add();
//Create a new PDF XFA form
PdfXfaForm mainForm = new PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width);
//Create a radio button group
PdfXfaRadioButtonGroup group = new PdfXfaRadioButtonGroup("radioGroup");
group.FlowDirection = PdfXfaFlowDirection.Vertical;
//Create a radio button field and add the properties.
PdfXfaRadioButtonField radioButtonField1 = new PdfXfaRadioButtonField("r1", new SizeF(80, 20));
//Set the caption text.
radioButtonField1.Caption.Text = "Male";
PdfXfaRadioButtonField radioButtonField2 = new PdfXfaRadioButtonField("r2", new SizeF(80, 20));
radioButtonField2.Caption.Text = "Female";
//Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1);
group.Items.Add(radioButtonField2);
//Clone the radio button.
group.Items.Add(radioButtonField2.Clone() as PdfXfaRadioButtonField);
//Add the field to the XFA form.
mainForm.Fields.Add(group);
//Add the XFA form to the document.
document.XfaForm = mainForm;
//Save the document.
document.Save("XfaForm.pdf", PdfXfaType.Dynamic);
//close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Add a new XFA page.
Dim xfaPage As PdfXfaPage = document.Pages.Add()
'Create a new PDF XFA form
Dim mainForm As New PdfXfaForm("subform1", xfaPage, xfaPage.GetClientSize().Width)
'Create a radio button group 
Dim group As New PdfXfaRadioButtonGroup("radioGroup")
group.FlowDirection = PdfXfaFlowDirection.Vertical
'Create a radio button field and add the properties.
Dim radioButtonField1 As New PdfXfaRadioButtonField("r1", New SizeF(80, 20))
'Set the caption text.
radioButtonField1.Caption.Text = "Male"
Dim radioButtonField2 As New PdfXfaRadioButtonField("r2", New SizeF(80, 20))
radioButtonField2.Caption.Text = "Female"
'Add the radio button fields to the radio button group
group.Items.Add(radioButtonField1)
group.Items.Add(radioButtonField2)
'Clone the radio button.
group.Items.Add( TryCase(radioButtonField2.Clone(), PdfXfaRadioButtonField))
'Add the field to the XFA form.
mainForm.Fields.Add(group)
'Add the XFA form to the document.
document.XfaForm = mainForm
'Save the document.
document.Save("XfaForm.pdf",PdfXfaType.Dynamic)
'close the document
document.Close()