Class DocumentRenderer

All Implemented Interfaces:
IPropertyContainer, IRenderer
Direct Known Subclasses:
ColumnDocumentRenderer

public class DocumentRenderer extends RootRenderer
  • Field Details

  • Constructor Details

    • DocumentRenderer

      public DocumentRenderer (Document document)
    • DocumentRenderer

      public DocumentRenderer (Document document, boolean immediateFlush)
  • Method Details

    • getTargetCounterHandler

      public TargetCounterHandler getTargetCounterHandler()
      Get handler for target-counters.
      Returns:
      the TargetCounterHandler instance
    • isRelayoutRequired

      public boolean isRelayoutRequired()
      Indicates if relayout is required for targetCounterHandler.
      Returns:
      true if relayout is required, false otherwise
    • getOccupiedArea

      public LayoutArea getOccupiedArea()
      Description copied from class: AbstractRenderer
      Gets the resultant occupied area after the last call to the IRenderer.layout(LayoutContext) method.
      Specified by:
      getOccupiedArea in interface IRenderer
      Overrides:
      getOccupiedArea in class AbstractRenderer
      Returns:
      LayoutArea instance
    • getNextRenderer

      public IRenderer getNextRenderer()
      For DocumentRenderer, this has a meaning of the renderer that will be used for relayout.
      Returns:
      relayout renderer.
    • updateCurrentArea

      protected LayoutArea updateCurrentArea (LayoutResult overflowResult)
      Specified by:
      updateCurrentArea in class RootRenderer
    • flushSingleRenderer

      protected void flushSingleRenderer (IRenderer resultRenderer)
      Specified by:
      flushSingleRenderer in class RootRenderer
    • addNewPage

      protected PageSize addNewPage (PageSize customPageSize)
      Adds new page with defined page size to PDF document.
      Parameters:
      customPageSize - the size of new page, can be null
      Returns:
      the page size of created page
    • ensureDocumentHasNPages

      protected PageSize ensureDocumentHasNPages (int n, PageSize customPageSize)
      Ensures that PDF document has n pages. If document has fewer pages, adds new pages by calling addNewPage(PageSize) method.
      Parameters:
      n - the expected number of pages if document
      customPageSize - the size of created pages, can be null
      Returns:
      the page size of the last created page, or null if no page was created