Table of Contents

Class BlockRenderer

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

Represents a renderer for block elements.

public abstract class BlockRenderer : AbstractRenderer, IRenderer, IPropertyContainer
Inheritance
BlockRenderer
Implements
Derived
Inherited Members

Constructors

BlockRenderer(IElement)

Creates a BlockRenderer from its corresponding layout object.

protected BlockRenderer(IElement modelElement)

Parameters

modelElement IElement

the IElement which this object should manage

Methods

ApplyRotationLayout(Rectangle)

This method rotates content of the renderer and calculates correct occupied area for the rotated element.

protected virtual void ApplyRotationLayout(Rectangle layoutBox)

Parameters

layoutBox Rectangle

a Rectangle

ApplyVerticalAlignment()

This method applies vertical alignment for the occupied area of the renderer and its children renderers.

protected virtual void ApplyVerticalAlignment()

BeginRotationIfApplied(PdfCanvas)

This method starts rotation for the renderer if rotation angle property is specified.

protected virtual void BeginRotationIfApplied(PdfCanvas canvas)

Parameters

canvas PdfCanvas

the PdfCanvas to draw on

CreateOverflowRenderer(int)

Creates an overflow renderer.

protected virtual AbstractRenderer CreateOverflowRenderer(int layoutResult)

Parameters

layoutResult int

the result of content layouting

Returns

AbstractRenderer

a new AbstractRenderer instance

CreateRotationTransformInsideOccupiedArea()

This method creates AffineTransform instance that could be used to rotate content inside the occupied area.

protected virtual AffineTransform CreateRotationTransformInsideOccupiedArea()

Returns

AffineTransform

AffineTransform that rotates the content and places it inside occupied area.

Remarks

This method creates AffineTransform instance that could be used to rotate content inside the occupied area. Be aware that it should be used only after layout rendering is finished and correct occupied area for the rotated element is calculated.

CreateSplitRenderer(int)

Creates a split renderer.

protected virtual AbstractRenderer CreateSplitRenderer(int layoutResult)

Parameters

layoutResult int

the result of content layouting

Returns

AbstractRenderer

a new AbstractRenderer instance

Draw(DrawContext)

public override void Draw(DrawContext drawContext)

Parameters

drawContext DrawContext

EndRotationIfApplied(PdfCanvas)

This method ends rotation for the renderer if applied.

protected virtual void EndRotationIfApplied(PdfCanvas canvas)

Parameters

canvas PdfCanvas

the PdfCanvas to draw on

GetMinMaxWidth()

public override MinMaxWidth GetMinMaxWidth()

Returns

MinMaxWidth

GetOccupiedAreaBBox()

public override Rectangle GetOccupiedAreaBBox()

Returns

Rectangle

GetResolvedFont(PdfDocument)

Get the font set in properties, if it is not set, then resolves the first PdfFont from FontProvider.

protected virtual PdfFont GetResolvedFont(PdfDocument pdfDocument)

Parameters

pdfDocument PdfDocument

the PdfDocument to get default font from.

Returns

PdfFont

the font or null if it is not set and FontProvider is not set.

Remarks

Get the font set in properties, if it is not set, then resolves the first PdfFont from FontProvider. If FontProvider is not set, then returns null.

Layout(LayoutContext)

public override LayoutResult Layout(LayoutContext layoutContext)

Parameters

layoutContext LayoutContext

Returns

LayoutResult