Table of Contents

Class TableRenderer

Namespace
iText.Layout.Renderer
Assembly
itext.layout.dll

This class represents the renderer object for a Table object.

public class TableRenderer : AbstractRenderer, IRenderer, IPropertyContainer
Inheritance
TableRenderer
Implements
Inherited Members

Remarks

This class represents the renderer object for a Table object. It will delegate its drawing operations on to the CellRenderer instances associated with the table cells.

Constructors

TableRenderer(Table)

Creates a TableRenderer from a Table.

public TableRenderer(Table modelElement)

Parameters

modelElement Table

the table to be rendered by this renderer

TableRenderer(Table, RowRange)

Creates a TableRenderer from a Table which will partially render the table.

public TableRenderer(Table modelElement, Table.RowRange rowRange)

Parameters

modelElement Table

the table to be rendered by this renderer

rowRange Table.RowRange

the table rows to be rendered

Fields

captionRenderer

protected DivRenderer captionRenderer

Field Value

DivRenderer

footerRenderer

protected TableRenderer footerRenderer

Field Value

TableRenderer

headerRenderer

protected TableRenderer headerRenderer

Field Value

TableRenderer

isOriginalNonSplitRenderer

True for newly created renderer.

protected bool isOriginalNonSplitRenderer

Field Value

bool

Remarks

True for newly created renderer. For split renderers this is set to false. Used for tricky layout.

rowRange

protected Table.RowRange rowRange

Field Value

Table.RowRange

rows

protected IList<CellRenderer[]> rows

Field Value

IList<CellRenderer[]>

Methods

AddChild(IRenderer)

public override void AddChild(IRenderer renderer)

Parameters

renderer IRenderer

AllowLastYLineRecursiveExtraction()

protected override bool AllowLastYLineRecursiveExtraction()

Returns

bool

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, bool)

public override Rectangle ApplyPaddings(Rectangle rect, bool reverse)

Parameters

rect Rectangle
reverse bool

Returns

Rectangle

ApplyPaddings(Rectangle, UnitValue[], bool)

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

Parameters

rect Rectangle
paddings UnitValue[]
reverse bool

Returns

Rectangle

CreateOverflowRenderer(RowRange)

protected virtual TableRenderer CreateOverflowRenderer(Table.RowRange rowRange)

Parameters

rowRange Table.RowRange

Returns

TableRenderer

CreateSplitRenderer(RowRange)

protected virtual TableRenderer CreateSplitRenderer(Table.RowRange rowRange)

Parameters

rowRange Table.RowRange

Returns

TableRenderer

Draw(DrawContext)

public override void Draw(DrawContext drawContext)

Parameters

drawContext DrawContext

DrawBackground(DrawContext)

public override void DrawBackground(DrawContext drawContext)

Parameters

drawContext DrawContext

DrawBackgrounds(DrawContext)

protected virtual void DrawBackgrounds(DrawContext drawContext)

Parameters

drawContext DrawContext

DrawBorder(DrawContext)

public override void DrawBorder(DrawContext drawContext)

Parameters

drawContext DrawContext

DrawBorders(DrawContext)

protected virtual void DrawBorders(DrawContext drawContext)

Parameters

drawContext DrawContext

DrawCaption(DrawContext)

protected virtual void DrawCaption(DrawContext drawContext)

Parameters

drawContext DrawContext

DrawChildren(DrawContext)

public override void DrawChildren(DrawContext drawContext)

Parameters

drawContext DrawContext

ExtendLastRow(CellRenderer[], Rectangle)

protected virtual void ExtendLastRow(CellRenderer[] lastRow, Rectangle freeBox)

Parameters

lastRow CellRenderer[]
freeBox Rectangle

GetMinMaxWidth()

public override MinMaxWidth GetMinMaxWidth()

Returns

MinMaxWidth

GetNextRenderer()

Gets a new instance of this class to be used as a next renderer, after this renderer is used, if Layout(LayoutContext) is called more than once.

public override IRenderer GetNextRenderer()

Returns

IRenderer

new renderer instance

Remarks

Gets a new instance of this class to be used as a next renderer, after this renderer is used, if Layout(LayoutContext) is called more than once.

If a renderer overflows to the next area, iText uses this method to create a renderer for the overflow part. So if one wants to extend TableRenderer , one should override this method: otherwise the default method will be used and thus the default rather than the custom renderer will be created.

Layout(LayoutContext)

public override LayoutResult Layout(LayoutContext layoutContext)

Parameters

layoutContext LayoutContext

Returns

LayoutResult

Move(float, float)

public override void Move(float dxRight, float dyUp)

Parameters

dxRight float
dyUp float

RetrieveWidth(float)

protected override float? RetrieveWidth(float parentBoxWidth)

Parameters

parentBoxWidth float

Returns

float?

Split(int)

protected virtual TableRenderer[] Split(int row)

Parameters

row int

Returns

TableRenderer[]

Split(int, bool)

protected virtual TableRenderer[] Split(int row, bool hasContent)

Parameters

row int
hasContent bool

Returns

TableRenderer[]

Split(int, bool, bool)

protected virtual TableRenderer[] Split(int row, bool hasContent, bool cellWithBigRowspanAdded)

Parameters

row int
hasContent bool
cellWithBigRowspanAdded bool

Returns

TableRenderer[]