Class LineRenderer

java.lang.Object
com.itextpdf.layout.renderer.AbstractRenderer
com.itextpdf.layout.renderer.LineRenderer
All Implemented Interfaces:
IPropertyContainer, IRenderer

public class LineRenderer extends AbstractRenderer
  • Field Details

    • maxAscent

      protected float maxAscent
    • maxDescent

      protected float maxDescent
    • levels

      protected byte[] levels
  • Constructor Details

    • LineRenderer

      public LineRenderer()
  • Method Details

    • layout

      public LayoutResult layout (LayoutContext layoutContext)
      Description copied from interface: IRenderer
      This method simulates positioning of the renderer, including all of its children, and returns the LayoutResult, representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc. LayoutResult can be extended to return custom layout results for custom elements, e.g. TextRenderer uses TextLayoutResult as its result. This method can be called standalone to learn how much area the renderer subtree needs, or can be called before IRenderer.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
    • getMaxAscent

      public float getMaxAscent()
    • getMaxDescent

      public float getMaxDescent()
    • getYLine

      public float getYLine()
    • getLeadingValue

      public float getLeadingValue (Leading leading)
    • getNextRenderer

      public IRenderer getNextRenderer()
      Description copied from interface: IRenderer
      Gets a new instance of this class to be used as a next renderer, after this renderer is used, if IRenderer.layout(LayoutContext) is called more than once.
      Returns:
      new renderer instance
    • getFirstYLineRecursively

      protected Float getFirstYLineRecursively()
      Description copied from class: AbstractRenderer
      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.
      Overrides:
      getFirstYLineRecursively in class AbstractRenderer
      Returns:
      the first yline of the nested children, null if there is no text found
    • getLastYLineRecursively

      protected Float getLastYLineRecursively()
      Overrides:
      getLastYLineRecursively in class AbstractRenderer
    • justify

      public void justify (float width)
    • getNumberOfSpaces

      protected int getNumberOfSpaces()
    • length

      protected int length()
      Gets the total lengths of characters in this line. Other elements (images, tables) are not taken into account.
      Returns:
      the total lengths of characters in this line.
    • baseCharactersCount

      protected int baseCharactersCount()
      Returns the number of base characters, i.e. non-mark characters
      Returns:
      the number of base non-mark characters
    • toString

      public String toString()
      Description copied from class: AbstractRenderer
      Returns a string representation of the renderer.
      Overrides:
      toString in class AbstractRenderer
      Returns:
      a String
      See Also:
    • createSplitRenderer

      protected LineRenderer createSplitRenderer()
    • createOverflowRenderer

      protected LineRenderer createOverflowRenderer()
    • split

      protected LineRenderer[] split()
    • adjustChildrenYLine

      protected LineRenderer adjustChildrenYLine()
    • applyLeading

      protected void applyLeading (float deltaY)
    • trimLast

      protected LineRenderer trimLast()
    • containsImage

      public boolean containsImage()
    • getMinMaxWidth

      public MinMaxWidth getMinMaxWidth()
      Description copied from class: AbstractRenderer
      Calculates min and max width values for current renderer.
      Overrides:
      getMinMaxWidth in class AbstractRenderer
      Returns:
      instance of MinMaxWidth