Class PdfXfaCheckBoxField
- Namespace
- Syncfusion.Pdf.Xfa
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents checkbox field of the XFA form.
public class PdfXfaCheckBoxField : PdfXfaStyledField
- Inheritance
-
PdfXfaCheckBoxField
- Inherited Members
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.
public PdfXfaCheckBoxField(string name, SizeF size)
Parameters
name
stringThe name of the check box field.
size
SizeFThe 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, bool)
Initializes a new instance of the PdfXfaCheckBoxField class.
public PdfXfaCheckBoxField(string name, SizeF size, bool isChecked)
Parameters
name
stringThe name of the check box field
size
SizeFThe size of the check box field
isChecked
boolThe 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, float, float)
Initializes a new instance of the PdfXfaCheckBoxField class.
public PdfXfaCheckBoxField(string name, float width, float height)
Parameters
name
stringName of the check box field.
width
floatCheck box field width.
height
floatCheck 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, float, float, bool)
Initializes a new instance of the PdfXfaCheckBoxField class.
public PdfXfaCheckBoxField(string name, float width, float height, bool isChecked)
Parameters
name
stringName of the check box field.
width
floatCheck box field width.
height
floatCheck box field height.
isChecked
boolChecked 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
public PdfXfaCaption Caption { get; set; }
Property Value
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
public PdfXfaCheckBoxAppearance CheckBoxAppearance { get; set; }
Property Value
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
public float CheckBoxSize { get; set; }
Property Value
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
public PdfXfaCheckedStyle CheckedStyle { get; set; }
Property Value
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
public bool IsChecked { get; set; }
Property Value
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.
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();
//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()