Class PagedBoxCollector

java.lang.Object
com.openhtmltopdf.render.displaylist.PagedBoxCollector

public class PagedBoxCollector
extends Object
  • Field Details

    • PAGE_BASE_ONLY

      public static final int PAGE_BASE_ONLY
      Add collected items to base page only, ignoring inserted shadow pages.
      See Also:
      Constant Field Values
    • PAGE_ALL

      public static final int PAGE_ALL
      Add collected boxes to all pages, including inserted shadow pages.
      See Also:
      Constant Field Values
  • Constructor Details

    • PagedBoxCollector

      public PagedBoxCollector​(List<PageBox> pages, int minPage, int maxPage)
      A more efficient paged box collector that can only find boxes on pages minPage to maxPage inclusive.
  • Method Details

    • collect

      public void collect​(CssContext c, Layer layer)
    • collectFloats

      public void collectFloats​(CssContext c, Layer layer)
    • collect

      public void collect​(CssContext c, Layer layer, Box container, int shadowPageNumber)
      The main box collection method. This method works recursively to add all the boxes (inlines and blocks separately) owned by this layer to their respective flat page display lists. It also adds clip and setClip operations where needed to clip content in overflow:hiddenblocks.
      Parameters:
      c -
      layer -
      container -
    • collect

      public void collect​(CssContext c, Layer layer, Box container, int pgStart, int pgEnd, int shadowPageNumber)
    • findPageForY

      public static int findPageForY​(CssContext c, double y, List<PageBox> pages)
    • getShadowPageForBounds

      public static int getShadowPageForBounds​(CssContext c, Rectangle bounds, PageBox page)
    • findAdjustedBoundsForBorderBox

      public static Rectangle findAdjustedBoundsForBorderBox​(CssContext c, Box container, List<PageBox> pages)
      Finds the document coordinates border box bounds of a box adjusted for transform and clipped according to overflow hidden.
    • findAdjustedBoundsForContentBox

      public static Rectangle findAdjustedBoundsForContentBox​(CssContext c, Box container)
      Finds the document coordinates content box bounds of a box adjusted for transform and clipped according to overflow hidden.
    • findStartPage

      protected int findStartPage​(CssContext c, Rectangle bounds, AffineTransform transform)
    • findEndPage

      protected int findEndPage​(CssContext c, Rectangle bounds, AffineTransform transform)
    • findStartPage

      protected int findStartPage​(CssContext c, Box container, AffineTransform transform)
    • findEndPage

      protected int findEndPage​(CssContext c, Box container, AffineTransform transform)
    • getPageResult

      protected PagedBoxCollector.PageResult getPageResult​(int pageNo)
    • getMaxPageNumber

      protected int getMaxPageNumber()
    • getMinPageNumber

      protected int getMinPageNumber()
    • getValidMinPageNumber

      protected int getValidMinPageNumber​(int pageNo)
    • getValidMaxPageNumber

      protected int getValidMaxPageNumber​(int pageNo)
    • getPageBox

      protected PageBox getPageBox​(int pageNo)
    • findLayerRect

      public static Rectangle findLayerRect​(CssContext c, Layer layer)
    • findLayerPages

      public static List<PagedBoxCollector.PageInfo> findLayerPages​(CssContext c, Layer layer, List<PageBox> pages)
      Returns the pages a layer appears on including inserted overflow pages. Takes into account any transform and overflow hidden clipping.
    • findStartPage

      public static int findStartPage​(CssContext c, Box container, List<PageBox> pages)
      Returns:
      0 based page number of start of container paint area (including overflow)
    • findEndPage

      public static int findEndPage​(CssContext c, Box container, List<PageBox> pages)
      Returns:
      0 based page number of end of container paint area (including overflow)