Class PdfXfaCheckBoxField
Represents checkbox field of the XFA form.
Inherited Members
Namespace: Syncfusion.Pdf.Xfa
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfXfaCheckBoxField : PdfXfaStyledField
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30));
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30))
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
Constructors
PdfXfaCheckBoxField(String, SizeF)
Initializes a new instance of the PdfXfaCheckBoxField class.
Declaration
public PdfXfaCheckBoxField(string name, SizeF size)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the check box field. |
SizeF | size | The size of the check box field. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30));
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30))
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaCheckBoxField(String, SizeF, Boolean)
Initializes a new instance of the PdfXfaCheckBoxField class.
Declaration
public PdfXfaCheckBoxField(string name, SizeF size, bool isChecked)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | The name of the check box field |
SizeF | size | The size of the check box field |
System.Boolean | isChecked | The checked state of the check box |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30), true);
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30), True)
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaCheckBoxField(String, Single, Single)
Initializes a new instance of the PdfXfaCheckBoxField class.
Declaration
public PdfXfaCheckBoxField(string name, float width, float height)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the check box field. |
System.Single | width | Check box field width. |
System.Single | height | Check box field height. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", 100, 30);
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", 100, 30)
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
PdfXfaCheckBoxField(String, Single, Single, Boolean)
Initializes a new instance of the PdfXfaCheckBoxField class.
Declaration
public PdfXfaCheckBoxField(string name, float width, float height, bool isChecked)
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the check box field. |
System.Single | width | Check box field width. |
System.Single | height | Check box field height. |
System.Boolean | isChecked | Checked state of the field. |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", 100, 30, true);
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", 100, 30, True)
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.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();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30));
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30))
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
CheckBoxAppearance
Gets or sets the appearance of the check box field
Declaration
public PdfXfaCheckBoxAppearance CheckBoxAppearance { get; set; }
Property Value
Type |
---|
PdfXfaCheckBoxAppearance |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30));
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30))
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
CheckBoxSize
Gets or sets the check box size
Declaration
public float CheckBoxSize { get; set; }
Property Value
Type |
---|
System.Single |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30));
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30))
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
CheckedStyle
Gets or sets the checked Style of the check box field
Declaration
public PdfXfaCheckedStyle CheckedStyle { get; set; }
Property Value
Type |
---|
PdfXfaCheckedStyle |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30));
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30))
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()
IsChecked
Gets or sets a value indicating whether this is checked or not
Declaration
public bool IsChecked { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
//Create a new PDF XFA document.
PdfXfaDocument document = new PdfXfaDocument();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30));
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30))
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
document.XfaForm = xfaForm
'Save the document.
document.Save("output.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();
//Create a form.
PdfXfaForm xfaForm = new PdfXfaForm(PdfXfaFlowDirection.Vertical, 595);
//Set margin of the form.
xfaForm.Margins.All = 10;
//Create new XFA check box field.
PdfXfaCheckBoxField field = new PdfXfaCheckBoxField("check1", new SizeF(100, 30));
//Set caption.
field.Caption.Text = "CheckBox";
//Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square;
//Set the check box size.
field.CheckBoxSize = 10;
//Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross;
//Set the check box checked state.
field.IsChecked = true;
//Add the field to form.
xfaForm.Fields.Add(field);
//Clone the check box field.
xfaForm.Fields.Add(field.Clone() as PdfXfaCheckBoxField);
document.XfaForm = xfaForm;
//Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic);
//Close the document
document.Close();
'Create a new PDF XFA document.
Dim document As New PdfXfaDocument()
'Create a form.
Dim xfaForm As New PdfXfaForm(PdfXfaFlowDirection.Vertical, 595)
'Set margin of the form.
xfaForm.Margins.All = 10
'Create new XFA check box field.
Dim field As New PdfXfaCheckBoxField("check1", New SizeF(100, 30))
'Set caption.
field.Caption.Text = "CheckBox"
'Set checkbox appearance.
field.CheckBoxAppearance = PdfXfaCheckBoxAppearance.Square
'Set the check box size.
field.CheckBoxSize = 10
'Set the checked style.
field.CheckedStyle = PdfXfaCheckedStyle.Cross
'Set the check box checked state.
field.IsChecked = True
'Add the field to form.
xfaForm.Fields.Add(field)
'Clone the check box field.
xfaForm.Fields.Add(TryCast(field.Clone(), PdfXfaCheckBoxField))
document.XfaForm = xfaForm
'Save the document.
document.Save("output.pdf", PdfXfaType.Dynamic)
'Close the document
document.Close()