Class DocumentRenderer

All Implemented Interfaces:
IPropertyContainer, IRenderer
Direct Known Subclasses:

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.
      the TargetCounterHandler instance
    • isRelayoutRequired

      public boolean isRelayoutRequired()
      Indicates if relayout is required for targetCounterHandler.
      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
      getOccupiedArea in class AbstractRenderer
      LayoutArea instance
    • getNextRenderer

      public IRenderer getNextRenderer()
      For DocumentRenderer, this has a meaning of the renderer that will be used for relayout.
      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.
      customPageSize - the size of new page, can be null
      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.
      n - the expected number of pages if document
      customPageSize - the size of created pages, can be null
      the page size of the last created page, or null if no page was created