iText 7 7.1.9 API
iText.Layout.Renderer.AbstractRenderer Class Referenceabstract

Defines the most common properties and behavior that are shared by most IRenderer implementations. More...

Inheritance diagram for iText.Layout.Renderer.AbstractRenderer:
iText.Layout.Renderer.IRenderer iText.Layout.IPropertyContainer iText.Layout.Renderer.BlockRenderer iText.Layout.Renderer.ImageRenderer iText.Layout.Renderer.LineRenderer iText.Layout.Renderer.RootRenderer iText.Layout.Renderer.TableRenderer iText.Layout.Renderer.TabRenderer iText.Layout.Renderer.TextRenderer iText.Layout.Renderer.CellRenderer iText.Layout.Renderer.DivRenderer iText.Layout.Renderer.LineSeparatorRenderer iText.Layout.Renderer.ListRenderer iText.Layout.Renderer.ParagraphRenderer iText.Layout.Renderer.CanvasRenderer iText.Layout.Renderer.DocumentRenderer iText.Layout.Renderer.LinkRenderer

Public Member Functions

virtual void  AddChild (IRenderer renderer)
  Adds a child to the current renderer More...
 
virtual IPropertyContainer  GetModelElement ()
  Gets the model element associated with this renderer. More...
 
virtual IList< IRenderer GetChildRenderers ()
  Gets the child IRenderer s. More...
 
virtual bool  HasProperty (int property)
  Checks if this entity has the specified property. More...
 
virtual bool  HasOwnProperty (int property)
  Checks if this entity has the specified property, i.e. if it was set to this very element earlier More...
 
virtual bool  HasOwnOrModelProperty (int property)
  Checks if this renderer or its model element have the specified property, i.e. if it was set to this very element or its very model element earlier. More...
 
virtual void  DeleteOwnProperty (int property)
  Deletes the own property of this entity. More...
 
virtual void  DeleteProperty (int property)
  Deletes property from this very renderer, or in case the property is specified on its model element, the property of the model element is deleted More...
 
virtual T1  GetProperty< T1 > (int key)
  Gets the property from this entity. More...
 
virtual T1  GetOwnProperty< T1 > (int property)
  Gets own property from this entity. More...
 
virtual T1  GetProperty< T1 > (int property, T1 defaultValue)
  Gets a property from this entity or one of its hierarchical parents. More...
 
virtual void  SetProperty (int property, Object value)
  Sets a property for this entity. More...
 
virtual T1  GetDefaultProperty< T1 > (int property)
  Gets the default property from this entity. More...
 
virtual PdfFont  GetPropertyAsFont (int property)
  Returns a property with a certain key, as a font object. More...
 
virtual Color  GetPropertyAsColor (int property)
  Returns a property with a certain key, as a color. More...
 
virtual TransparentColor  GetPropertyAsTransparentColor (int property)
  Returns a property with a certain key, as a iText.Layout.Properties.TransparentColor. More...
 
virtual ? float  GetPropertyAsFloat (int property)
  Returns a property with a certain key, as a floating point value. More...
 
virtual ? float  GetPropertyAsFloat (int property, float? defaultValue)
  Returns a property with a certain key, as a floating point value. More...
 
virtual ? bool  GetPropertyAsBoolean (int property)
  Returns a property with a certain key, as a boolean value. More...
 
virtual UnitValue  GetPropertyAsUnitValue (int property)
  Returns a property with a certain key, as a unit value. More...
 
virtual ? int  GetPropertyAsInteger (int property)
  Returns a property with a certain key, as an integer value. More...
 
override String  ToString ()
  Returns a string representation of the renderer. More...
 
virtual LayoutArea  GetOccupiedArea ()
  Gets the resultant occupied area after the last call to the Layout(iText.Layout.Layout.LayoutContext) method. More...
 
virtual void  Draw (DrawContext drawContext)
  Flushes the renderer subtree contents, i.e. draws itself on canvas, adds necessary objects to the iText.Kernel.Pdf.PdfDocument etc. More...
 
virtual void  DrawBackground (DrawContext drawContext)
  Draws a background layer if it is defined by a key iText.Layout.Properties.Property.BACKGROUND in either the layout element or this IRenderer itself. More...
 
virtual void  DrawChildren (DrawContext drawContext)
  Performs the drawing operation for all children of this renderer. More...
 
virtual void  DrawBorder (DrawContext drawContext)
  Performs the drawing operation for the border of this renderer, if defined by any of the iText.Layout.Properties.Property.BORDER values in either the layout element or this IRenderer itself. More...
 
virtual bool  IsFlushed ()
  Indicates whether this renderer is flushed or not, i.e. if Draw(DrawContext) has already been called. More...
 
virtual IRenderer  SetParent (IRenderer parent)
  Explicitly sets this object as the child of another IRenderer in the renderer hierarchy. More...
 
virtual IRenderer  GetParent ()
  Gets the parent IRenderer. More...
 
virtual void  Move (float dxRight, float dyUp)
  Moves the renderer subtree by the specified offset. More...
 
virtual IList< Rectangle InitElementAreas (LayoutArea area)
  Gets all rectangles that this IRenderer can draw upon in the given area. More...
 
virtual Rectangle  GetOccupiedAreaBBox ()
  Gets the bounding box that contains all content written to the DrawContext by this IRenderer. More...
 
virtual Rectangle  GetBorderAreaBBox ()
  Gets the border box of a renderer. More...
 
virtual Rectangle  GetInnerAreaBBox ()
 
virtual Rectangle  ApplyMargins (Rectangle rect, bool reverse)
  Applies margins of the renderer on the given rectangle More...
 
virtual Rectangle  ApplyBorderBox (Rectangle rect, bool reverse)
  Applies the border box of the renderer on the given rectangle If the border of a certain side is null, the side will remain as it was. More...
 
virtual Rectangle  ApplyPaddings (Rectangle rect, bool reverse)
  Applies paddings of the renderer on the given rectangle More...
 
virtual bool  IsFirstOnRootArea ()
 
virtual MinMaxWidth  GetMinMaxWidth ()
 
abstract IRenderer  GetNextRenderer ()
  Gets a new instance of this class to be used as a next renderer, after this renderer is used, if Layout(iText.Layout.Layout.LayoutContext) is called more than once. More...
 
abstract LayoutResult  Layout (LayoutContext arg1)
  This method simulates positioning of the renderer, including all of its children, and returns the iText.Layout.Layout.LayoutResult , representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc. More...
 

Detailed Description

Defines the most common properties and behavior that are shared by most IRenderer implementations.

Defines the most common properties and behavior that are shared by most IRenderer implementations. All default Renderers are subclasses of this default implementation.

Member Function Documentation

◆ AddChild()

virtual void iText.Layout.Renderer.AbstractRenderer.AddChild ( IRenderer  renderer )
inlinevirtual

◆ ApplyBorderBox()

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.ApplyBorderBox ( Rectangle  rect,
bool  reverse 
)
inlinevirtual

Applies the border box of the renderer on the given rectangle If the border of a certain side is null, the side will remain as it was.

Parameters
rect a rectangle the border box will be applied on.
reverse indicates whether the border box will be applied inside (in case of false) or outside (in case of false) the rectangle.
Returns
a border box of the renderer
See also
GetBorders()

◆ ApplyMargins()

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.ApplyMargins ( Rectangle  rect,
bool  reverse 
)
inlinevirtual

Applies margins of the renderer on the given rectangle

Parameters
rect a rectangle margins will be applied on.
reverse indicates whether margins will be applied inside (in case of false) or outside (in case of true) the rectangle.
Returns
a border box of the renderer
See also
GetMargins()

◆ ApplyPaddings()

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.ApplyPaddings ( Rectangle  rect,
bool  reverse 
)
inlinevirtual

Applies paddings of the renderer on the given rectangle

Parameters
rect a rectangle paddings will be applied on.
reverse indicates whether paddings will be applied inside (in case of false) or outside (in case of false) the rectangle.
Returns
a border box of the renderer
See also
GetPaddings()

Reimplemented in iText.Layout.Renderer.TableRenderer.

◆ DeleteOwnProperty()

virtual void iText.Layout.Renderer.AbstractRenderer.DeleteOwnProperty ( int  property )
inlinevirtual

Deletes the own property of this entity.

Implements iText.Layout.IPropertyContainer.

◆ DeleteProperty()

virtual void iText.Layout.Renderer.AbstractRenderer.DeleteProperty ( int  property )
inlinevirtual

Deletes property from this very renderer, or in case the property is specified on its model element, the property of the model element is deleted

Parameters
property the property key to be deleted

◆ Draw()

virtual void iText.Layout.Renderer.AbstractRenderer.Draw ( DrawContext  drawContext )
inlinevirtual

◆ DrawBackground()

virtual void iText.Layout.Renderer.AbstractRenderer.DrawBackground ( DrawContext  drawContext )
inlinevirtual

Draws a background layer if it is defined by a key iText.Layout.Properties.Property.BACKGROUND in either the layout element or this IRenderer itself.

Parameters
drawContext the context (canvas, document, etc) of this drawing operation.

Reimplemented in iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.TextRenderer, and iText.Layout.Renderer.CellRenderer.

◆ DrawBorder()

virtual void iText.Layout.Renderer.AbstractRenderer.DrawBorder ( DrawContext  drawContext )
inlinevirtual

Performs the drawing operation for the border of this renderer, if defined by any of the iText.Layout.Properties.Property.BORDER values in either the layout element or this IRenderer itself.

Parameters
drawContext the context (canvas, document, etc) of this drawing operation.

Reimplemented in iText.Layout.Renderer.TableRenderer, and iText.Layout.Renderer.CellRenderer.

◆ DrawChildren()

virtual void iText.Layout.Renderer.AbstractRenderer.DrawChildren ( DrawContext  drawContext )
inlinevirtual

Performs the drawing operation for all children of this renderer.

Parameters
drawContext the context (canvas, document, etc) of this drawing operation.

Reimplemented in iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.ParagraphRenderer, and iText.Layout.Renderer.LineSeparatorRenderer.

◆ GetBorderAreaBBox()

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.GetBorderAreaBBox ( )
inlinevirtual

Gets the border box of a renderer.

Gets the border box of a renderer. This is a box used to draw borders.

Returns
border box of a renderer

Reimplemented in iText.Layout.Renderer.ImageRenderer.

◆ GetChildRenderers()

virtual IList<IRenderer> iText.Layout.Renderer.AbstractRenderer.GetChildRenderers ( )
inlinevirtual

Gets the child IRenderer s.

Implements iText.Layout.Renderer.IRenderer.

◆ GetDefaultProperty< T1 >()

virtual T1 iText.Layout.Renderer.AbstractRenderer.GetDefaultProperty< T1 > ( int  property )
inlinevirtual

Gets the default property from this entity.

Implements iText.Layout.IPropertyContainer.

Reimplemented in iText.Layout.Renderer.ParagraphRenderer.

◆ GetModelElement()

virtual IPropertyContainer iText.Layout.Renderer.AbstractRenderer.GetModelElement ( )
inlinevirtual

Gets the model element associated with this renderer.

Implements iText.Layout.Renderer.IRenderer.

Reimplemented in iText.Layout.Renderer.CellRenderer.

◆ GetNextRenderer()

◆ GetOccupiedArea()

virtual LayoutArea iText.Layout.Renderer.AbstractRenderer.GetOccupiedArea ( )
inlinevirtual

Gets the resultant occupied area after the last call to the Layout(iText.Layout.Layout.LayoutContext) method.

Implements iText.Layout.Renderer.IRenderer.

Reimplemented in iText.Layout.Renderer.DocumentRenderer.

◆ GetOccupiedAreaBBox()

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.GetOccupiedAreaBBox ( )
inlinevirtual

Gets the bounding box that contains all content written to the DrawContext by this IRenderer.

Returns
the smallest iText.Kernel.Geom.Rectangle that surrounds the content

Reimplemented in iText.Layout.Renderer.BlockRenderer.

◆ GetOwnProperty< T1 >()

virtual T1 iText.Layout.Renderer.AbstractRenderer.GetOwnProperty< T1 > ( int  property )
inlinevirtual

Gets own property from this entity.

Implements iText.Layout.IPropertyContainer.

◆ GetParent()

virtual IRenderer iText.Layout.Renderer.AbstractRenderer.GetParent ( )
inlinevirtual

Gets the parent IRenderer.

Implements iText.Layout.Renderer.IRenderer.

◆ GetProperty< T1 >() [1/2]

virtual T1 iText.Layout.Renderer.AbstractRenderer.GetProperty< T1 > ( int  key )
inlinevirtual

Gets the property from this entity.

Implements iText.Layout.IPropertyContainer.

◆ GetProperty< T1 >() [2/2]

virtual T1 iText.Layout.Renderer.AbstractRenderer.GetProperty< T1 > ( int  property,
T1  defaultValue 
)
inlinevirtual

Gets a property from this entity or one of its hierarchical parents.

Implements iText.Layout.Renderer.IRenderer.

◆ GetPropertyAsBoolean()

virtual ? bool iText.Layout.Renderer.AbstractRenderer.GetPropertyAsBoolean ( int  property )
inlinevirtual

Returns a property with a certain key, as a boolean value.

Parameters
property an enum value
Returns
a bool?

◆ GetPropertyAsColor()

virtual Color iText.Layout.Renderer.AbstractRenderer.GetPropertyAsColor ( int  property )
inlinevirtual

Returns a property with a certain key, as a color.

Parameters
property an enum value
Returns
a iText.Kernel.Colors.Color

◆ GetPropertyAsFloat() [1/2]

virtual ? float iText.Layout.Renderer.AbstractRenderer.GetPropertyAsFloat ( int  property )
inlinevirtual

Returns a property with a certain key, as a floating point value.

Parameters
property an enum value
Returns
a float?

◆ GetPropertyAsFloat() [2/2]

virtual ? float iText.Layout.Renderer.AbstractRenderer.GetPropertyAsFloat ( int  property,
float?  defaultValue 
)
inlinevirtual

Returns a property with a certain key, as a floating point value.

Parameters
property an enum value
defaultValue default value to be returned if property is not found
Returns
a float?

◆ GetPropertyAsFont()

virtual PdfFont iText.Layout.Renderer.AbstractRenderer.GetPropertyAsFont ( int  property )
inlinevirtual

Returns a property with a certain key, as a font object.

Parameters
property an enum value
Returns
a iText.Kernel.Font.PdfFont

◆ GetPropertyAsInteger()

virtual ? int iText.Layout.Renderer.AbstractRenderer.GetPropertyAsInteger ( int  property )
inlinevirtual

Returns a property with a certain key, as an integer value.

Parameters
property an enum value
Returns
a int?

◆ GetPropertyAsTransparentColor()

virtual TransparentColor iText.Layout.Renderer.AbstractRenderer.GetPropertyAsTransparentColor ( int  property )
inlinevirtual

Returns a property with a certain key, as a iText.Layout.Properties.TransparentColor.

Parameters
property an enum value
Returns
a iText.Layout.Properties.TransparentColor

◆ GetPropertyAsUnitValue()

virtual UnitValue iText.Layout.Renderer.AbstractRenderer.GetPropertyAsUnitValue ( int  property )
inlinevirtual

Returns a property with a certain key, as a unit value.

Parameters
property an enum value
Returns
a iText.Layout.Properties.UnitValue

◆ HasOwnOrModelProperty()

virtual bool iText.Layout.Renderer.AbstractRenderer.HasOwnOrModelProperty ( int  property )
inlinevirtual

Checks if this renderer or its model element have the specified property, i.e. if it was set to this very element or its very model element earlier.

Parameters
property the property to be checked
Returns

true if this instance or its model element have given own property, false otherwise

◆ HasOwnProperty()

virtual bool iText.Layout.Renderer.AbstractRenderer.HasOwnProperty ( int  property )
inlinevirtual

Checks if this entity has the specified property, i.e. if it was set to this very element earlier

Implements iText.Layout.IPropertyContainer.

◆ HasProperty()

virtual bool iText.Layout.Renderer.AbstractRenderer.HasProperty ( int  property )
inlinevirtual

Checks if this entity has the specified property.

Implements iText.Layout.IPropertyContainer.

◆ InitElementAreas()

virtual IList<Rectangle> iText.Layout.Renderer.AbstractRenderer.InitElementAreas ( LayoutArea  area )
inlinevirtual

Gets all rectangles that this IRenderer can draw upon in the given area.

Parameters
area a physical area on the DrawContext
Returns
a list of rectangles

◆ IsFlushed()

virtual bool iText.Layout.Renderer.AbstractRenderer.IsFlushed ( )
inlinevirtual

Indicates whether this renderer is flushed or not, i.e. if Draw(DrawContext) has already been called.

Returns
whether the renderer has been flushed
See also
Draw(DrawContext)

Implements iText.Layout.Renderer.IRenderer.

◆ Layout()

abstract LayoutResult iText.Layout.Renderer.AbstractRenderer.Layout ( LayoutContext  layoutContext )
pure virtual

This method simulates positioning of the renderer, including all of its children, and returns the iText.Layout.Layout.LayoutResult , representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc.

This method simulates positioning of the renderer, including all of its children, and returns the iText.Layout.Layout.LayoutResult , representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc. iText.Layout.Layout.LayoutResult can be extended to return custom layout results for custom elements, e.g. TextRenderer uses iText.Layout.Layout.TextLayoutResult as its result. This method can be called standalone to learn how much area the renderer subtree needs, or can be called before Draw(DrawContext) , to prepare the renderer to be flushed to the output stream.

Parameters
layoutContext the description of layout area and any other additional information
Returns
result of the layout process

Implements iText.Layout.Renderer.IRenderer.

Implemented in iText.Layout.Renderer.RootRenderer, iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.TextRenderer, iText.Layout.Renderer.ImageRenderer, iText.Layout.Renderer.ParagraphRenderer, iText.Layout.Renderer.LineRenderer, iText.Layout.Renderer.ListItemRenderer, iText.Layout.Renderer.ListRenderer, iText.Layout.Renderer.BlockRenderer, iText.Layout.Renderer.TabRenderer, and iText.Layout.Renderer.LineSeparatorRenderer.

◆ Move()

virtual void iText.Layout.Renderer.AbstractRenderer.Move ( float  dxRight,
float  dyUp 
)
inlinevirtual

◆ SetParent()

virtual IRenderer iText.Layout.Renderer.AbstractRenderer.SetParent ( IRenderer  parent )
inlinevirtual

Explicitly sets this object as the child of another IRenderer in the renderer hierarchy.

Implements iText.Layout.Renderer.IRenderer.

◆ SetProperty()

virtual void iText.Layout.Renderer.AbstractRenderer.SetProperty ( int  property,
Object  value 
)
inlinevirtual

Sets a property for this entity.

Implements iText.Layout.IPropertyContainer.

◆ ToString()

override String iText.Layout.Renderer.AbstractRenderer.ToString ( )
inline

Returns a string representation of the renderer.

Returns
a System.String
See also
System.Object.ToString()