Table of Contents

Class CheckBoxRenderer

Namespace
iText.Forms.Form.Renderer
Assembly
itext.forms.dll

The AbstractFormFieldRenderer implementation for checkboxes.

public class CheckBoxRenderer : AbstractFormFieldRenderer, IRenderer, IPropertyContainer
Inheritance
CheckBoxRenderer
Implements
Inherited Members

Constructors

CheckBoxRenderer(CheckBox)

Creates a new CheckBoxRenderer instance.

public CheckBoxRenderer(CheckBox modelElement)

Parameters

modelElement CheckBox

the model element

Fields

DEFAULT_BORDER_WIDTH

public const float DEFAULT_BORDER_WIDTH = 0.75

Field Value

float

Methods

AdjustFieldLayout(LayoutContext)

Adjusts the field layout.

protected override void AdjustFieldLayout(LayoutContext layoutContext)

Parameters

layoutContext LayoutContext

layout context

ApplyAcroField(DrawContext)

protected override void ApplyAcroField(DrawContext drawContext)

Parameters

drawContext DrawContext

ApplyBorderBox(Rectangle, Border[], bool)

protected override Rectangle ApplyBorderBox(Rectangle rect, Border[] borders, bool reverse)

Parameters

rect Rectangle
borders Border[]
reverse bool

Returns

Rectangle

ApplyPaddings(Rectangle, UnitValue[], bool)

Applies given paddings to the given rectangle.

protected override Rectangle ApplyPaddings(Rectangle rect, UnitValue[] paddings, bool reverse)

Parameters

rect Rectangle

a rectangle paddings will be applied on.

paddings UnitValue[]

the paddings to be applied on the given rectangle

reverse bool

indicates whether paddings will be applied inside (in case of false) or outside (in case of true) the rectangle.

Returns

Rectangle

The rectangle NOT modified by the paddings.

Remarks

Applies given paddings to the given rectangle. Checkboxes don't support setting of paddings as they are always centered. So that this method returns the rectangle as is.

CreateCheckBoxRenderStrategy()

creates a ICheckBoxRenderingStrategy based on the current settings.

public virtual ICheckBoxRenderingStrategy CreateCheckBoxRenderStrategy()

Returns

ICheckBoxRenderingStrategy

the ICheckBoxRenderingStrategy

CreateFlatRenderer()

Creates a flat renderer for the checkbox.

protected override IRenderer CreateFlatRenderer()

Returns

IRenderer

an IRenderer object for the flat renderer

DrawBackground(DrawContext)

public override void DrawBackground(DrawContext drawContext)

Parameters

drawContext DrawContext

DrawBorder(DrawContext)

public override void DrawBorder(DrawContext drawContext)

Parameters

drawContext DrawContext

GetCheckBoxType()

Gets the checkBoxType.

public virtual CheckBoxType GetCheckBoxType()

Returns

CheckBoxType

the checkBoxType

GetNextRenderer()

public override IRenderer GetNextRenderer()

Returns

IRenderer

GetRenderingMode()

Gets the rendering mode of the checkbox.

public virtual RenderingMode? GetRenderingMode()

Returns

RenderingMode?

the rendering mode of the checkbox

IsBoxChecked()

Defines whether the box is checked or not.

public virtual bool IsBoxChecked()

Returns

bool

the default value of the checkbox field

IsLayoutBasedOnFlatRenderer()

protected override bool IsLayoutBasedOnFlatRenderer()

Returns

bool

IsPdfA()

Returns whether or not the checkbox is in PDF/A mode.

[Obsolete("since 8.0.4 will be removed")]
public virtual bool IsPdfA()

Returns

bool

true if the checkbox is in PDF/A mode, false otherwise