Class PdfLoadedCheckBoxField
- Namespace
- Syncfusion.Pdf.Parsing
- Assembly
- Syncfusion.Pdf.Portable.dll
Represents check box of an existing PDF document.
public class PdfLoadedCheckBoxField : PdfLoadedStateField, INotifyPropertyChanged
- Inheritance
-
PdfLoadedCheckBoxField
- Implements
- Inherited Members
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing Check field
PdfLoadedCheckBoxField checkField = doc.Form.Fields["Java"] as PdfLoadedCheckBoxField;
checkField.Checked = true;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'Load an existing Check field
Dim checkField As PdfLoadedCheckBoxField = TryCast(doc.Form.Fields("Java"), PdfLoadedCheckBoxField)
checkField.Checked = True
doc.Save("Form.pdf")
doc.Close(True)
Properties
BackColor
Gets or sets the back color of the field
public PdfColor BackColor { get; set; }
Property Value
- See Also
Checked
Gets or sets a value indicating whether this PdfLoadedCheckBoxField is checked.
public bool Checked { get; set; }
Property Value
- bool
True if the check box is checked, false otherwise.
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing Check field
PdfLoadedCheckBoxField checkField = doc.Form.Fields["Java"] as PdfLoadedCheckBoxField;
checkField.Checked = true;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Load an existing Check field
Dim checkField As PdfLoadedCheckBoxField = TryCast(doc.Form.Fields("Java"), PdfLoadedCheckBoxField)
checkField.Checked = True
doc.Save("Form.pdf")
doc.Close(True)
- See Also
ForeColor
Gets or sets the fore color of the field.
public PdfColor ForeColor { get; set; }
Property Value
- See Also
Items
Gets the collection of check box items.[Read-Only]
public PdfLoadedCheckBoxItemCollection Items { get; }
Property Value
Examples
//Load an existing document.
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
// Load an existing Check field
PdfLoadedCheckBoxField checkField = doc.Form.Fields["Java"] as PdfLoadedCheckBoxField;
// Loads the check box items collection.
PdfLoadedCheckBoxItemCollection checkCollection = checkField.Items;
checkCollection[0].Checked = false;
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document.
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
' Load an existing Check field
Dim checkField As PdfLoadedCheckBoxField = TryCast(doc.Form.Fields("Java"), PdfLoadedCheckBoxField)
' Loads the check box items collection.
Dim checkCollection As PdfLoadedCheckBoxItemCollection = checkField.Items
checkCollection(0).Checked = False
doc.Save("Form.pdf")
doc.Close(True)
- See Also
Style
Gets or sets the checkbox style of the field.
public PdfCheckBoxStyle Style { get; set; }
Property Value
- See Also
Methods
Remove(PdfLoadedCheckBoxItem)
Remove the particular PdfLoadedCheckBoxItem from PdfLoadedCheckBoxField.
public void Remove(PdfLoadedCheckBoxItem item)
Parameters
Examples
//Load an existing document
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
//Get the loaded form.
PdfLoadedForm loadedForm = loadedDocument.Form;
//Get the checkBox Field
PdfLoadedCheckBoxField checkBoxField = loadedForm.Fields[0] as PdfLoadedCheckBoxField;
//Get the checkBoxField Item
PdfLoadedCheckBoxItem checkBoxFieldItem = checkBoxField.Items[0] as PdfLoadedCheckBoxItem;
//Remove the checkBoxField item
loadedField.Remove(checkBoxFieldItem);
//Save the modified document.
loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
- See Also
RemoveAt(int)
Remove the PdfLoadedCheckBoxField item at the specified index.
public void RemoveAt(int index)
Parameters
index
int
Examples
//Load an existing document
PdfLoadedDocument loadedDocument = new PdfLoadedDocument("input.pdf");
//Get the loaded form.
PdfLoadedForm loadedForm = loadedDocument.Form;
//Get the checkBoxField
PdfLoadedCheckBoxField checkBoxField = loadedForm.Fields[0] as PdfLoadedCheckBoxField;
//Remove the checkBoxField item
checkBoxField.RemoveAt(0);
//Save the modified document.
loadedDocument.Save("form.pdf");
//Close the document
loadedDocument.Close(true);
- See Also
TryGetFieldItem(string, out PdfLoadedCheckBoxItem)
Get the PdfLoadedCheckBoxItem using export value from PdfLoadedCheckBoxField
public bool TryGetFieldItem(string exportValue, out PdfLoadedCheckBoxItem field)
Parameters
exportValue
stringfield
PdfLoadedCheckBoxItem
Returns
Examples
//Load an existing document
PdfLoadedDocument doc = new PdfLoadedDocument("SourceForm.pdf");
//Load an existing Check field
PdfLoadedCheckBoxField checkField = doc.Form.Fields["Java"] as PdfLoadedCheckBoxField;
PdfLoadedCheckBoxItem checkBoxItem = null;
//Get checkbox item using an export value
checkField.TryGetFieldItem("3", out checkBoxItem);
doc.Save("Form.pdf");
doc.Close(true);
'Load an existing document
Dim doc As PdfLoadedDocument = New PdfLoadedDocument("SourceForm.pdf")
'Load an existing Check field
Dim checkField As PdfLoadedCheckBoxField = TryCast(doc.Form.Fields("Java"), PdfLoadedCheckBoxField)
'Get checkbox item using an export value
Dim checkBoxItem As PdfLoadedCheckBoxItem = Nothing
checkField.TryGetFieldItem("3", checkBoxItem)
doc.Save("Form.pdf")
doc.Close(True)
- See Also