menu

WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfXfaRadioButtonField - WPF API Reference | Syncfusion

    Show / Hide Table of Contents

    Class PdfXfaRadioButtonField

    Represents the XFA radio button field

    Inheritance
    System.Object
    PdfXfaField
    PdfXfaStyledField
    PdfXfaRadioButtonField
    Inherited Members
    PdfXfaField.Margins
    PdfXfaField.Name
    PdfXfaField.Visibility
    PdfXfaStyledField.Border
    PdfXfaStyledField.Font
    PdfXfaStyledField.ForeColor
    PdfXfaStyledField.Height
    PdfXfaStyledField.HorizontalAlignment
    PdfXfaStyledField.ReadOnly
    PdfXfaStyledField.Rotate
    PdfXfaStyledField.ToolTip
    PdfXfaStyledField.VerticalAlignment
    PdfXfaStyledField.Width
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.ToString()
    Namespace: Syncfusion.Pdf.Xfa
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfXfaRadioButtonField : PdfXfaStyledField
    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.

    Declaration
    public PdfXfaRadioButtonField(string name, SizeF size)
    Parameters
    Type Name Description
    System.String name

    Name of the radio button field.

    System.Drawing.SizeF size

    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, Single, Single)

    Initializes a new instance of the PdfXfaRadioButtonField class.

    Declaration
    public PdfXfaRadioButtonField(string name, float width, float height)
    Parameters
    Type Name Description
    System.String name

    Name of the radio button field.

    System.Single width

    Width of the radio button field.

    System.Single height

    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

    Declaration
    public PdfXfaCaption Caption { get; set; }
    Property Value
    Type
    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

    Declaration
    public PdfXfaCheckedStyle CheckedStyle { get; set; }
    Property Value
    Type
    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.

    Declaration
    public bool IsChecked { get; set; }
    Property Value
    Type
    System.Boolean
    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

    Declaration
    public PdfXfaCheckBoxAppearance RadioButtonAppearance { get; set; }
    Property Value
    Type
    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

    Declaration
    public float RadioButtonSize { get; set; }
    Property Value
    Type
    System.Single
    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.

    Declaration
    public object Clone()
    Returns
    Type Description
    System.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()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved