iText 8.0.5 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.MulticolRenderer iText.Layout.Renderer.RootRenderer iText.Layout.Renderer.TableRenderer iText.Layout.Renderer.TabRenderer iText.Layout.Renderer.TextRenderer

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 ()
  Calculates min and max width values for current renderer. More...
 
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...
 

Static Public Member Functions

static PdfFormXObject  CreateXObject (AbstractLinearGradientBuilder linearGradientBuilder, Rectangle xObjectArea, PdfDocument document)
  Create a iText.Kernel.Pdf.Xobject.PdfFormXObject with the given area and containing a linear gradient inside. More...
 

Static Public Attributes

const float  OVERLAP_EPSILON = 1e-4f
 

Package Functions

  AbstractRenderer ()
  Creates a renderer. More...
 
  AbstractRenderer (IElement modelElement)
  Creates a renderer for the specified layout element. More...
 
  AbstractRenderer (iText.Layout.Renderer.AbstractRenderer other)
  Creates a new renderer based on an instance of another renderer. More...
 
virtual void  BeginElementOpacityApplying (DrawContext drawContext)
  Apply Property.OPACITY property if specified by setting corresponding values in graphic state dictionary opacity will be applied to all elements drawn after calling this method and before calling EndElementOpacityApplying(DrawContext) ()}. More...
 
virtual void  EndElementOpacityApplying (DrawContext drawContext)
  BeginElementOpacityApplying(DrawContext). More...
 
virtual Rectangle  GetBackgroundArea (Rectangle occupiedAreaWithMargins)
  Evaluate the actual background More...
 
virtual bool  ClipBorderArea (DrawContext drawContext, Rectangle outerBorderBox)
 
virtual bool  ClipBackgroundArea (DrawContext drawContext, Rectangle outerBorderBox)
 
virtual bool  ClipBackgroundArea (DrawContext drawContext, Rectangle outerBorderBox, bool considerBordersBeforeClipping)
 
virtual void  ApplyDestinationsAndAnnotation (DrawContext drawContext)
 
virtual bool  IsOverflowProperty (OverflowPropertyValue? equalsTo, int overflowProperty)
 
virtual ? float  RetrieveWidth (float parentBoxWidth)
  Retrieves element's fixed content box width, if it's set. More...
 
virtual ? float  RetrieveMaxWidth (float parentBoxWidth)
  Retrieves element's fixed content box max width, if it's set. More...
 
virtual ? float  RetrieveMinWidth (float parentBoxWidth)
  Retrieves element's fixed content box max width, if it's set. More...
 
virtual void  UpdateWidth (UnitValue updatedWidthValue)
  Updates fixed content box width value for this renderer. More...
 
virtual ? float  RetrieveHeight ()
  Retrieves the element's fixed content box height, if it's set. More...
 
virtual void  UpdateHeight (UnitValue updatedHeight)
  Updates fixed content box height value for this renderer. More...
 
virtual ? float  RetrieveMaxHeight ()
  Retrieve element's content box max-ehight, if it's set. More...
 
virtual void  UpdateMaxHeight (UnitValue updatedMaxHeight)
  Updates content box max-height value for this renderer. More...
 
virtual ? float  RetrieveMinHeight ()
  Retrieves element's content box min-height, if it's set. More...
 
virtual void  UpdateMinHeight (UnitValue updatedMinHeight)
  Updates content box min-height value for this renderer. More...
 
virtual ? float  RetrieveUnitValue (float baseValue, int property)
 
virtual ? float  RetrieveUnitValue (float baseValue, int property, bool pointOnly)
 
virtual IDictionary< int, Object >  GetOwnProperties ()
 
virtual void  AddAllProperties (IDictionary< int, Object > properties)
 
virtual ? float  GetFirstYLineRecursively ()
  Gets the first yLine of the nested children recursively. More...
 
virtual ? float  GetLastYLineRecursively ()
 
virtual bool  AllowLastYLineRecursiveExtraction ()
 
virtual Rectangle  ApplyMargins (Rectangle rect, UnitValue[] margins, bool reverse)
  Applies given margins on the given rectangle More...
 
virtual UnitValue[]  GetMargins ()
  Returns margins of the renderer [0] - top; [1] - right; [2] - bottom; [3] - left More...
 
virtual UnitValue[]  GetPaddings ()
  Returns paddings of the renderer [0] - top; [1] - right; [2] - bottom; [3] - left More...
 
virtual Rectangle  ApplyPaddings (Rectangle rect, UnitValue[] paddings, bool reverse)
  Applies given paddings to the given rectangle. More...
 
virtual Rectangle  ApplyBorderBox (Rectangle rect, Border[] borders, bool reverse)
  Applies the given border box (borders) on the given rectangle More...
 
virtual void  ApplyAbsolutePosition (Rectangle parentRect)
 
virtual void  ApplyRelativePositioningTranslation (bool reverse)
 
virtual void  ApplyDestination (PdfDocument document)
 
virtual void  ApplyAction (PdfDocument document)
 
virtual void  ApplyLinkAnnotation (PdfDocument document)
 
virtual void  UpdateHeightsOnSplit (bool wasHeightClipped, iText.Layout.Renderer.AbstractRenderer splitRenderer, iText.Layout.Renderer.AbstractRenderer overflowRenderer)
 
virtual bool  SetMinMaxWidthBasedOnFixedWidth (MinMaxWidth minMaxWidth)
 
virtual bool  IsNotFittingHeight (LayoutArea layoutArea)
 
virtual bool  IsNotFittingWidth (LayoutArea layoutArea)
 
virtual bool  IsNotFittingLayoutArea (LayoutArea layoutArea)
 
virtual bool  IsPositioned ()
  Indicates whether the renderer's position is fixed or not. More...
 
virtual bool  IsFixedLayout ()
  Indicates whether the renderer's position is fixed or not. More...
 
virtual bool  IsStaticLayout ()
 
virtual bool  IsRelativePosition ()
 
virtual bool  IsAbsolutePosition ()
 
virtual bool  IsKeepTogether ()
 
virtual void  AlignChildHorizontally (IRenderer childRenderer, Rectangle currentArea)
 
virtual Border[]  GetBorders ()
  Gets borders of the element in the specified order: top, right, bottom, left. More...
 
virtual BorderRadius[]  GetBorderRadii ()
  Gets border radii of the element in the specified order: top-left, top-right, bottom-right, bottom-left. More...
 
virtual iText.Layout.Renderer.AbstractRenderer  SetBorders (Border border, int borderNumber)
 
virtual Rectangle  CalculateAbsolutePdfBBox ()
  Calculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, e.g. document page or form xObject. More...
 
virtual Rectangle  CalculateBBox (IList< Point > points)
  Calculates bounding box around points. More...
 
virtual IList< Point RectangleToPointsList (Rectangle rect)
 
virtual IList< Point TransformPoints (IList< Point > points, AffineTransform transform)
 
virtual float[]  CalculateShiftToPositionBBoxOfPointsAt (float left, float top, IList< Point > points)
  This method calculates the shift needed to be applied to the points in order to position upper and left borders of their bounding box at the given lines. More...
 
virtual bool  HasAbsoluteUnitValue (int property)
  Check if corresponding property has point value. More...
 
virtual bool  HasRelativeUnitValue (int property)
  Check if corresponding property has relative value. More...
 
virtual void  BeginTransformationIfApplied (PdfCanvas canvas)
 
virtual void  EndTransformationIfApplied (PdfCanvas canvas)
 

Static Package Functions

static bool  IsBorderBoxSizing (IRenderer renderer)
 
static bool  IsOverflowProperty (OverflowPropertyValue? equalsTo, IRenderer renderer, int overflowProperty)
 
static bool  IsOverflowProperty (OverflowPropertyValue? equalsTo, OverflowPropertyValue? rendererOverflowProperty)
 
static bool  IsOverflowFit (OverflowPropertyValue? rendererOverflowProperty)
 

Package Attributes

IList< IRenderer childRenderers = new List<IRenderer>()
 
IList< IRenderer positionedRenderers = new List<IRenderer>()
 
IPropertyContainer  modelElement
 
bool  flushed = false
 
LayoutArea  occupiedArea
 
IRenderer  parent
 
IDictionary< int, Object >  properties = new Dictionary()
 
bool  isLastRendererForModelElement = true
 

Static Package Attributes

const float  EPS = 1e-4f
  The maximum difference between iText.Kernel.Geom.Rectangle coordinates to consider rectangles equal More...
 
const float  INF = 1e6f
  The infinity value which is used while layouting 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.

Constructor & Destructor Documentation

◆ AbstractRenderer() [1/3]

iText.Layout.Renderer.AbstractRenderer.AbstractRenderer ( )
inlinepackage

Creates a renderer.

◆ AbstractRenderer() [2/3]

iText.Layout.Renderer.AbstractRenderer.AbstractRenderer ( IElement  modelElement )
inlinepackage

Creates a renderer for the specified layout element.

Parameters
modelElement the layout element that will be drawn by this renderer

◆ AbstractRenderer() [3/3]

iText.Layout.Renderer.AbstractRenderer.AbstractRenderer ( iText.Layout.Renderer.AbstractRenderer  other )
inlinepackage

Creates a new renderer based on an instance of another renderer.

Parameters
other renderer from which to copy essential properties

Member Function Documentation

◆ AddChild()

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

◆ ApplyBorderBox() [1/2]

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 true) the rectangle.
Returns
a border box of the renderer
See also
GetBorders()

◆ ApplyBorderBox() [2/2]

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.ApplyBorderBox ( Rectangle  rect,
Border[]  borders,
bool  reverse 
)
inlinepackagevirtual

Applies the given border box (borders) on the given rectangle

Parameters
rect a rectangle paddings will be applied on.
borders the borders to be applied on the given rectangle
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

Reimplemented in iText.Forms.Form.Renderer.CheckBoxRenderer, iText.Layout.Renderer.TableRenderer, iText.Layout.Renderer.CellRenderer, and iText.Forms.Form.Renderer.RadioRenderer.

◆ ApplyMargins() [1/2]

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

◆ ApplyMargins() [2/2]

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.ApplyMargins ( Rectangle  rect,
UnitValue[]  margins,
bool  reverse 
)
inlinepackagevirtual

Applies given margins on the given rectangle

Parameters
rect a rectangle margins will be applied on.
margins the margins to be applied on the given rectangle
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

Reimplemented in iText.Layout.Renderer.CellRenderer.

◆ ApplyPaddings() [1/2]

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 true) the rectangle.
Returns
a border box of the renderer
See also
GetPaddings()

Reimplemented in iText.Layout.Renderer.TableRenderer.

◆ ApplyPaddings() [2/2]

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.ApplyPaddings ( Rectangle  rect,
UnitValue[]  paddings,
bool  reverse 
)
inlinepackagevirtual

Applies given paddings to the given rectangle.

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

Reimplemented in iText.Layout.Renderer.ImageRenderer, iText.Forms.Form.Renderer.CheckBoxRenderer, and iText.Layout.Renderer.TableRenderer.

◆ BeginElementOpacityApplying()

virtual void iText.Layout.Renderer.AbstractRenderer.BeginElementOpacityApplying ( DrawContext  drawContext )
inlinepackagevirtual

Apply Property.OPACITY property if specified by setting corresponding values in graphic state dictionary opacity will be applied to all elements drawn after calling this method and before calling EndElementOpacityApplying(DrawContext) ()}.

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

◆ CalculateAbsolutePdfBBox()

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.CalculateAbsolutePdfBBox ( )
inlinepackagevirtual

Calculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, e.g. document page or form xObject.

Calculates the bounding box of the content in the coordinate system of the pdf entity on which content is placed, e.g. document page or form xObject. This is particularly useful for the cases when element is nested in the rotated element.

Returns
a iText.Kernel.Geom.Rectangle which is a bbox of the content not relative to the parent's layout area but rather to the some pdf entity coordinate system.

◆ CalculateBBox()

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.CalculateBBox ( IList< Point points )
inlinepackagevirtual

Calculates bounding box around points.

Parameters
points list of the points calculated bbox will enclose.
Returns
array of float values which denote left, bottom, right, top lines of bbox in this specific order

◆ CalculateShiftToPositionBBoxOfPointsAt()

virtual float [] iText.Layout.Renderer.AbstractRenderer.CalculateShiftToPositionBBoxOfPointsAt ( float  left,
float  top,
IList< Point points 
)
inlinepackagevirtual

This method calculates the shift needed to be applied to the points in order to position upper and left borders of their bounding box at the given lines.

Parameters
left x coordinate at which points bbox left border is to be aligned
top y coordinate at which points bbox upper border is to be aligned
points the points, which bbox will be aligned at the given position
Returns
array of two floats, where first element denotes x-coordinate shift and the second element denotes y-coordinate shift which are needed to align points bbox at the given lines.

◆ CreateXObject()

static PdfFormXObject iText.Layout.Renderer.AbstractRenderer.CreateXObject ( AbstractLinearGradientBuilder  linearGradientBuilder,
Rectangle  xObjectArea,
PdfDocument  document 
)
inlinestatic

Create a iText.Kernel.Pdf.Xobject.PdfFormXObject with the given area and containing a linear gradient inside.

Parameters
linearGradientBuilder the linear gradient builder
xObjectArea the result object area
document the pdf document
Returns
the xObject with a specified area and a linear gradient

◆ 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()

◆ 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.Forms.Form.Renderer.CheckBoxRenderer, iText.Forms.Form.Renderer.RadioRenderer, 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, iText.Layout.Renderer.MulticolRenderer, iText.Forms.Form.Renderer.CheckBoxRenderer, iText.Layout.Renderer.CellRenderer, and iText.Forms.Form.Renderer.RadioRenderer.

◆ DrawChildren()

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

◆ EndElementOpacityApplying()

virtual void iText.Layout.Renderer.AbstractRenderer.EndElementOpacityApplying ( DrawContext  drawContext )
inlinepackagevirtual

BeginElementOpacityApplying(DrawContext).

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

◆ GetBackgroundArea()

virtual Rectangle iText.Layout.Renderer.AbstractRenderer.GetBackgroundArea ( Rectangle  occupiedAreaWithMargins )
inlinepackagevirtual

Evaluate the actual background

Parameters
occupiedAreaWithMargins the current occupied area with applied margins
Returns
the actual background area

Reimplemented in iText.Layout.Renderer.TextRenderer.

◆ 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.

◆ GetBorderRadii()

virtual BorderRadius [] iText.Layout.Renderer.AbstractRenderer.GetBorderRadii ( )
inlinepackagevirtual

Gets border radii of the element in the specified order: top-left, top-right, bottom-right, bottom-left.

Returns
an array of BorderRadius objects. In case when certain border radius isn't set Property.BORDER_RADIUS is used, and if Property.BORDER_RADIUS is also not set then null is returned on position of this border radius

◆ GetBorders()

virtual Border [] iText.Layout.Renderer.AbstractRenderer.GetBorders ( )
inlinepackagevirtual

Gets borders of the element in the specified order: top, right, bottom, left.

Returns
an array of BorderDrawer objects. In case when certain border isn't set Property.BORDER is used, and if Property.BORDER is also not set then null is returned on position of this border

◆ 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.

◆ GetFirstYLineRecursively()

virtual ? float iText.Layout.Renderer.AbstractRenderer.GetFirstYLineRecursively ( )
inlinepackagevirtual

Gets the first yLine of the nested children recursively.

Gets the first yLine of the nested children recursively. E.g. for a list, this will be the yLine of the first item (if the first item is indeed a paragraph). NOTE: this method will no go further than the first child.

Returns
the first yline of the nested children, null if there is no text found

Reimplemented in iText.Layout.Renderer.TextRenderer, iText.Layout.Renderer.LineRenderer, and iText.Layout.Renderer.ParagraphRenderer.

◆ GetMargins()

virtual UnitValue [] iText.Layout.Renderer.AbstractRenderer.GetMargins ( )
inlinepackagevirtual

Returns margins of the renderer [0] - top; [1] - right; [2] - bottom; [3] - left

Returns
a float[] margins of the renderer

◆ GetMinMaxWidth()

◆ 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.

◆ GetPaddings()

virtual UnitValue [] iText.Layout.Renderer.AbstractRenderer.GetPaddings ( )
inlinepackagevirtual

Returns paddings of the renderer [0] - top; [1] - right; [2] - bottom; [3] - left

Returns
a float[] paddings of the renderer

◆ 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

◆ 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

◆ HasAbsoluteUnitValue()

virtual bool iText.Layout.Renderer.AbstractRenderer.HasAbsoluteUnitValue ( int  property )
inlinepackagevirtual

Check if corresponding property has point value.

Parameters
property

iText.Layout.Properties.Property

Returns
false if property value either null, or percent, otherwise true.

◆ 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.

◆ HasRelativeUnitValue()

virtual bool iText.Layout.Renderer.AbstractRenderer.HasRelativeUnitValue ( int  property )
inlinepackagevirtual

Check if corresponding property has relative value.

Parameters
property

iText.Layout.Properties.Property

Returns
false if property value either null, or point, otherwise true.

◆ 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

◆ IsFixedLayout()

virtual bool iText.Layout.Renderer.AbstractRenderer.IsFixedLayout ( )
inlinepackagevirtual

Indicates whether the renderer's position is fixed or not.

Returns
a boolean

◆ 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.

◆ IsPositioned()

virtual bool iText.Layout.Renderer.AbstractRenderer.IsPositioned ( )
inlinepackagevirtual

Indicates whether the renderer's position is fixed or not.

Returns
a boolean

◆ 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.Forms.Form.Renderer.SignatureAppearanceRenderer, iText.Forms.Form.Renderer.AbstractFormFieldRenderer, iText.Forms.Form.Renderer.TextAreaRenderer, iText.Layout.Renderer.ImageRenderer, iText.Layout.Renderer.FlexContainerRenderer, iText.Layout.Renderer.MulticolRenderer, iText.Layout.Renderer.ParagraphRenderer, iText.Layout.Renderer.LineRenderer, iText.Forms.Form.Renderer.SelectFieldListBoxRenderer, iText.Layout.Renderer.ListItemRenderer, iText.Layout.Renderer.GridContainerRenderer, iText.Layout.Renderer.BlockRenderer, iText.Forms.Form.Renderer.AbstractSelectFieldRenderer, iText.Layout.Renderer.ListRenderer, iText.Layout.Renderer.TabRenderer, and iText.Layout.Renderer.LineSeparatorRenderer.

◆ Move()

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

◆ RetrieveHeight()

virtual ? float iText.Layout.Renderer.AbstractRenderer.RetrieveHeight ( )
inlinepackagevirtual

Retrieves the element's fixed content box height, if it's set.

Retrieves the element's fixed content box height, if it's set. Takes into account iText.Layout.Properties.Property.BOX_SIZING , iText.Layout.Properties.Property.MIN_HEIGHT , and iText.Layout.Properties.Property.MAX_HEIGHT properties.

Returns
element's fixed content box height or null if it's not set.

◆ RetrieveMaxHeight()

virtual ? float iText.Layout.Renderer.AbstractRenderer.RetrieveMaxHeight ( )
inlinepackagevirtual

Retrieve element's content box max-ehight, if it's set.

Retrieve element's content box max-ehight, if it's set. Takes into account iText.Layout.Properties.Property.BOX_SIZING property value.

Returns
element's content box max-height or null if it's not set.

◆ RetrieveMaxWidth()

virtual ? float iText.Layout.Renderer.AbstractRenderer.RetrieveMaxWidth ( float  parentBoxWidth )
inlinepackagevirtual

Retrieves element's fixed content box max width, if it's set.

Retrieves element's fixed content box max width, if it's set. Takes into account iText.Layout.Properties.Property.BOX_SIZING and iText.Layout.Properties.Property.MIN_WIDTH properties.

Parameters
parentBoxWidth width of the parent element content box. If element has relative width, it will be calculated relatively to this parameter.
Returns
element's fixed content box max width or null if it's not set.
See also
HasAbsoluteUnitValue(int)

◆ RetrieveMinHeight()

virtual ? float iText.Layout.Renderer.AbstractRenderer.RetrieveMinHeight ( )
inlinepackagevirtual

Retrieves element's content box min-height, if it's set.

Retrieves element's content box min-height, if it's set. Takes into account iText.Layout.Properties.Property.BOX_SIZING property value.

Returns
element's content box min-height or null if it's not set.

◆ RetrieveMinWidth()

virtual ? float iText.Layout.Renderer.AbstractRenderer.RetrieveMinWidth ( float  parentBoxWidth )
inlinepackagevirtual

Retrieves element's fixed content box max width, if it's set.

Retrieves element's fixed content box max width, if it's set. Takes into account iText.Layout.Properties.Property.BOX_SIZING property value.

Parameters
parentBoxWidth width of the parent element content box. If element has relative width, it will be calculated relatively to this parameter.
Returns
element's fixed content box max width or null if it's not set.
See also
HasAbsoluteUnitValue(int)

◆ RetrieveWidth()

virtual ? float iText.Layout.Renderer.AbstractRenderer.RetrieveWidth ( float  parentBoxWidth )
inlinepackagevirtual

Retrieves element's fixed content box width, if it's set.

Retrieves element's fixed content box width, if it's set. Takes into account iText.Layout.Properties.Property.BOX_SIZING , iText.Layout.Properties.Property.MIN_WIDTH , and iText.Layout.Properties.Property.MAX_WIDTH properties.

Parameters
parentBoxWidth width of the parent element content box. If element has relative width, it will be calculated relatively to this parameter.
Returns
element's fixed content box width or null if it's not set.
See also
HasAbsoluteUnitValue(int)

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

◆ 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()

◆ UpdateHeight()

virtual void iText.Layout.Renderer.AbstractRenderer.UpdateHeight ( UnitValue  updatedHeight )
inlinepackagevirtual

Updates fixed content box height value for this renderer.

Updates fixed content box height value for this renderer. Takes into account iText.Layout.Properties.Property.BOX_SIZING property value.

Parameters
updatedHeight element's new fixed content box height, shall be not null.

◆ UpdateMaxHeight()

virtual void iText.Layout.Renderer.AbstractRenderer.UpdateMaxHeight ( UnitValue  updatedMaxHeight )
inlinepackagevirtual

Updates content box max-height value for this renderer.

Updates content box max-height value for this renderer. Takes into account iText.Layout.Properties.Property.BOX_SIZING property value.

Parameters
updatedMaxHeight element's new content box max-height, shall be not null.

◆ UpdateMinHeight()

virtual void iText.Layout.Renderer.AbstractRenderer.UpdateMinHeight ( UnitValue  updatedMinHeight )
inlinepackagevirtual

Updates content box min-height value for this renderer.

Updates content box min-height value for this renderer. Takes into account iText.Layout.Properties.Property.BOX_SIZING property value.

Parameters
updatedMinHeight element's new content box min-height, shall be not null.

◆ UpdateWidth()

virtual void iText.Layout.Renderer.AbstractRenderer.UpdateWidth ( UnitValue  updatedWidthValue )
inlinepackagevirtual

Updates fixed content box width value for this renderer.

Updates fixed content box width value for this renderer. Takes into account iText.Layout.Properties.Property.BOX_SIZING property value.

Parameters
updatedWidthValue element's new fixed content box width.

Member Data Documentation

◆ EPS

const float iText.Layout.Renderer.AbstractRenderer.EPS = 1e-4f
staticpackage

The maximum difference between iText.Kernel.Geom.Rectangle coordinates to consider rectangles equal

◆ INF

const float iText.Layout.Renderer.AbstractRenderer.INF = 1e6f
staticpackage

The infinity value which is used while layouting