Class PdfCheckFieldBase
Represents base class for field which can be in checked and unchecked states.
Inheritance
System.Object
PdfCheckFieldBase
Implements
System.ComponentModel.INotifyPropertyChanged
Inherited Members
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.NET.dll
Syntax
public class PdfCheckFieldBase : PdfStyledField, IPdfWrapper, INotifyPropertyChanged
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 12f);
PdfBrush brush = PdfBrushes.Black;
PdfGraphics graphics = page.Graphics;
//Create a check box
PdfCheckBoxField checkBox = new PdfCheckBoxField(page, "C#.NET");
checkBox.Bounds = new RectangleF(100, 290, 20, 20);
document.Form.Fields.Add(checkBox);
checkBox.HighlightMode = PdfHighlightMode.Push;
checkBox.BorderStyle = PdfBorderStyle.Beveled;
//Set the value for the check box
checkBox.Checked = true;
document.Form.Fields.Add(checkBox);
document.Save("Form.pdf");
document.Close(true);
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 12f)
Dim brush As PdfBrush = PdfBrushes.Black
Dim graphics As PdfGraphics = page.Graphics
'Create a check box
Dim checkBox As PdfCheckBoxField = New PdfCheckBoxField(page, "C#.NET")
checkBox.Bounds = New RectangleF(100, 290, 20, 20)
document.Form.Fields.Add(checkBox)
checkBox.HighlightMode = PdfHighlightMode.Push
checkBox.BorderStyle = PdfBorderStyle.Beveled
'Set the value for the check box
checkBox.Checked = True
document.Form.Fields.Add(checkBox)
document.Save("Form.pdf")
document.Close(True)
Constructors
PdfCheckFieldBase(PdfPageBase, String)
Initializes a new instance of the PdfCheckFieldBase class with the specific page and name.
Declaration
public PdfCheckFieldBase(PdfPageBase page, string name)
Parameters
Type | Name | Description |
---|---|---|
PdfPageBase | page | The page where the fields should be placed. |
System.String | name | The name of the check box field. |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 12f);
PdfBrush brush = PdfBrushes.Black;
PdfGraphics graphics = page.Graphics;
//Create a check box
PdfCheckBoxField checkBox = new PdfCheckBoxField(page, "C#.NET");
checkBox.Bounds = new RectangleF(100, 290, 20, 20);
document.Form.Fields.Add(checkBox);
checkBox.HighlightMode = PdfHighlightMode.Push;
checkBox.BorderStyle = PdfBorderStyle.Beveled;
//Set the value for the check box
checkBox.Checked = true;
document.Form.Fields.Add(checkBox);
document.Save("Form.pdf");
document.Close(true);
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 12f)
Dim brush As PdfBrush = PdfBrushes.Black
Dim graphics As PdfGraphics = page.Graphics
'Create a check box
Dim checkBox As PdfCheckBoxField = New PdfCheckBoxField(page, "C#.NET")
checkBox.Bounds = New RectangleF(100, 290, 20, 20)
document.Form.Fields.Add(checkBox)
checkBox.HighlightMode = PdfHighlightMode.Push
checkBox.BorderStyle = PdfBorderStyle.Beveled
'Set the value for the check box
checkBox.Checked = True
document.Form.Fields.Add(checkBox)
document.Save("Form.pdf")
document.Close(True)
See Also
Properties
Style
Gets or sets the style.
Declaration
public PdfCheckBoxStyle Style { get; set; }
Property Value
Type | Description |
---|---|
PdfCheckBoxStyle | The PdfCheckBoxStyle object specifies the style of the check box field. |
Examples
//Create a new PDf document
PdfDocument document = new PdfDocument();
//Creates a new page and adds it as the last page of the document
PdfPage page = document.Pages.Add();
PdfFont font = new PdfStandardFont(PdfFontFamily.Courier, 12f);
PdfBrush brush = PdfBrushes.Black;
PdfGraphics graphics = page.Graphics;
//Create a check box
PdfCheckBoxField checkBox = new PdfCheckBoxField(page, "C#.NET");
//Set the value for the check box
checkBox.Style = PdfCheckBoxStyle.Circle;
checkBox.Bounds = new RectangleF(100, 290, 20, 20);
document.Form.Fields.Add(checkBox);
checkBox.HighlightMode = PdfHighlightMode.Push;
checkBox.BorderStyle = PdfBorderStyle.Beveled;
//Set the value for the check box
checkBox.Checked = true;
document.Form.Fields.Add(checkBox);
document.Save("Form.pdf");
document.Close(true);
'Create a new PDf document
Dim document As PdfDocument = New PdfDocument()
'Create a page
Dim page As PdfPage = document.Pages.Add()
Dim font As PdfFont = New PdfStandardFont(PdfFontFamily.Courier, 12f)
Dim brush As PdfBrush = PdfBrushes.Black
Dim graphics As PdfGraphics = page.Graphics
'Create a check box
Dim checkBox As PdfCheckBoxField = New PdfCheckBoxField(page, "C#.NET")
'Set the value for the check box
checkBox.Style = PdfCheckBoxStyle.Circle
checkBox.Bounds = New RectangleF(100, 290, 20, 20)
document.Form.Fields.Add(checkBox)
checkBox.HighlightMode = PdfHighlightMode.Push
checkBox.BorderStyle = PdfBorderStyle.Beveled
'Set the value for the check box
checkBox.Checked = True
document.Form.Fields.Add(checkBox);
document.Save("Form.pdf")
document.Close(True)
See Also
Methods
DrawAppearance()
Draws the appearance.
Declaration
protected virtual void DrawAppearance()
Initialize()
Initializes an instance.
Declaration
protected override void Initialize()
Overrides
StyleToString(PdfCheckBoxStyle)
Styles to string.
Declaration
protected string StyleToString(PdfCheckBoxStyle style)
Parameters
Type | Name | Description |
---|---|---|
PdfCheckBoxStyle | style | The style. |
Returns
Type | Description |
---|---|
System.String | String representation of the check box' style. |
Implements
System.ComponentModel.INotifyPropertyChanged