Class MulticolRenderer

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

public class MulticolRenderer extends AbstractRenderer
Represents a renderer for columns.
  • Constructor Details

    • MulticolRenderer

      public MulticolRenderer (MulticolContainer modelElement)
      Creates a DivRenderer from its corresponding layout object.
      Parameters:
      modelElement - the MulticolContainer which this object should manage
  • Method Details

    • setHeightCalculator

      public final void setHeightCalculator (MulticolRenderer.ColumnHeightCalculator heightCalculator)
      Sets the height calculator to be used by this renderer.
      Parameters:
      heightCalculator - the height calculator to be used by this renderer.
    • layout

      public LayoutResult layout (LayoutContext layoutContext)
      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
    • getNextRenderer

      public IRenderer getNextRenderer()
      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
    • drawBorder

      public void drawBorder (DrawContext drawContext)
      Performs the drawing operation for the border of this renderer, if defined by any of the Property.BORDER values in either the layout element or this IRenderer itself.
      Overrides:
      drawBorder in class AbstractRenderer
      Parameters:
      drawContext - the context (canvas, document, etc) of this drawing operation.
    • layoutInColumns

      protected MulticolRenderer.MulticolLayoutResult layoutInColumns (LayoutContext layoutContext, Rectangle actualBBox)
      Layouts multicol in the passed area.
      Parameters:
      layoutContext - the layout context
      actualBBox - the area to layout multicol on
      Returns:
      the MulticolRenderer.MulticolLayoutResult instance
    • createSplitRenderer

      @Deprecated protected AbstractRenderer createSplitRenderer (List<IRenderer> children)
      Deprecated.
      use GridMulticolUtil.createSplitRenderer(List, AbstractRenderer)
      Creates a split renderer.
      Parameters:
      children - children of the split renderer
      Returns:
      a new AbstractRenderer instance
    • createOverflowRenderer

      protected AbstractRenderer createOverflowRenderer (IRenderer overflowedContentRenderer)
      Creates an overflow renderer.
      Parameters:
      overflowedContentRenderer - an overflowed content renderer
      Returns:
      a new AbstractRenderer instance