WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Class PdfCheckBoxField

    Show / Hide Table of Contents

    Class PdfCheckBoxField

    Represents check box field in the PDF form.

    Inheritance
    System.Object
    PdfField
    PdfStyledField
    PdfCheckFieldBase
    PdfCheckBoxField
    Implements
    System.ComponentModel.INotifyPropertyChanged
    Inherited Members
    PdfCheckFieldBase.StyleToString(PdfCheckBoxStyle)
    PdfCheckFieldBase.Initialize()
    PdfCheckFieldBase.Style
    PdfStyledField.ObtainFont()
    PdfStyledField.DefineDefaultAppearance()
    PdfStyledField.Bounds
    PdfStyledField.Visibility
    PdfStyledField.Location
    PdfStyledField.RotationAngle
    PdfStyledField.Size
    PdfStyledField.BorderColor
    PdfStyledField.BackColor
    PdfStyledField.ForeColor
    PdfStyledField.BorderWidth
    PdfStyledField.HighlightMode
    PdfStyledField.Font
    PdfStyledField.TextAlignment
    PdfStyledField.Actions
    PdfStyledField.BorderStyle
    PdfStyledField.Visible
    PdfField.GetValue(String)
    PdfField.SetValue(String, String)
    PdfField.Name
    PdfField.Form
    PdfField.MappingName
    PdfField.Export
    PdfField.ReadOnly
    PdfField.Required
    PdfField.ToolTip
    PdfField.Page
    PdfField.Flatten
    PdfField.DisableAutoFormat
    PdfField.PdfTag
    PdfField.TabIndex
    PdfField.Layer
    PdfField.PropertyChanged
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: Syncfusion.Pdf.Interactive
    Assembly: Syncfusion.Pdf.Base.dll
    Syntax
    public class PdfCheckBoxField : PdfCheckFieldBase, IPdfWrapper, INotifyPropertyChanged
    Remarks

    This PdfButtonField class is used to add the check box field to the PDF form. Please refer the UG docuemntation link for more details.

    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);
    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)
    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

    PdfCheckBoxField(PdfPageBase, String)

    Initializes a new instance of the PdfCheckBoxField class with the specific page and name.

    Declaration
    public PdfCheckBoxField(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);
    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)
    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
    PdfPage
    PdfDocument
    PdfFont

    Properties

    Checked

    Gets or sets a value indicating whether this PdfCheckBoxField is checked.

    Declaration
    public bool Checked { get; set; }
    Property Value
    Type Description
    System.Boolean

    true if checked; otherwise, false.

    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.Checked = true;       
    checkBox.Bounds = new RectangleF(100, 290, 20, 20);
    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.Checked = True
    checkBox.Bounds = New RectangleF(100, 290, 20, 20)
    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
    PdfPage
    PdfDocument
    PdfFont

    Methods

    DrawAppearance()

    Draws the appearance of the field.

    Declaration
    protected override void DrawAppearance()
    Overrides
    PdfCheckFieldBase.DrawAppearance()

    Implements

    System.ComponentModel.INotifyPropertyChanged

    See Also

    PdfCheckFieldBase
    PdfDocument
    PdfPage
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved