Top Inners Fields Constructors Methods
com.openhtmltopdf.render

public Class PageBox

extends Object
Class Inheritance
Imports
java.awt.Dimension, .Point, .Rectangle, java.io.IOException, .Writer, java.util.Iterator, .List, org.w3c.dom.Element, com.openhtmltopdf.css.constants.CSSName, .IdentValue, .MarginBoxName, com.openhtmltopdf.css.newmatch.PageInfo, com.openhtmltopdf.css.parser.CSSPrimitiveValue, .FSFunction, .PropertyValue, com.openhtmltopdf.css.sheet.PropertyDeclaration, com.openhtmltopdf.css.style.CalculatedStyle, .CssContext, com.openhtmltopdf.css.style.derived.LengthValue, .RectPropertySet, com.openhtmltopdf.extend.StructureType, com.openhtmltopdf.layout.BoxBuilder, .Layer, .LayoutContext, com.openhtmltopdf.newtable.TableBox, com.openhtmltopdf.render.simplepainter.SimplePainter, com.openhtmltopdf.util.ThreadCtx

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class
private static class
private static class
private abstract static class
private static class
private static class
private static class
private static class
private static class
private static class

Field Summary

Modifier and TypeField and Description
private int
private int
private PageBox.MarginAreaContainer[]
private Element
private int
private PageBox.PageDimensions
private PageInfo
private int
private int
private int
private int
private CalculatedStyle
private int
private int
private PageBox.MarginAreaContainer
private static final int
private static final PageBox.MarginArea[]

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
public void
public int
private Rectangle
getBorderEdge(int left, int top, CssContext cssCtx)

public int
getBottom()

Gets the document Y position in top down units (20 per CSS pixel for PDF) Example: If each page is 500px high and has a 50px margin, then if this is called on the second page it will return 16_000, which is 2 x 400px x 20.

public int
getBottom(CssContext c)

If we are in a footnote calls getBottom(), otherwise uses getBottomUsable().

public int
getBottomUsable()

Gets the document Y position taking into account float: bottom content such as footnotes.

public int
public int
public MarginBoxName[]
public IdentValue

Returns:

Either ltr (should insert cut-off content to the right of the page) or rtl (should insert cut-off content to the left of the page).
getCutOffPageDirection
()

public Rectangle
getDocumentCoordinatesContentBounds(CssContext c)

Get the rectangle that this page's content area will cover of the layed out document.

public Rectangle
getDocumentCoordinatesContentBoundsForInsertedPage(CssContext c, int shadowPageNumber)

Get the shadow page (a page inserted to carry cut off content) content area of the layed out document.

public int
public float
getFootnoteMaxHeight(CssContext c)

Gets the footnote area max-height if it is provided in the footnote at-rule for this page, otherwise -1.

public int
public RectPropertySet
public int
public int
getMaxInsertedPages()

The maximum number of shadow pages to insert for cut-off content.

public int
getMaxShadowPagesForXPos(CssContext c, int x)

Returns the number of shadow pages needed for a given x coordinate.

public Element
public int
public Rectangle
getPagedViewClippingBounds(CssContext cssCtx, int additionalClearance)

public PageInfo
public int
public int
public int

Returns:

the y index into the document coordinates.
getPaintingTop
()

Example: If a page is 100 units high and has a 10 unit margin, this will return 0 for the first page and 80 for the second and so on.

public Rectangle
public Rectangle
public Rectangle
getScreenPaintingBounds(CssContext cssCtx, int additionalClearance)

public int
public CalculatedStyle
public int
getTop()

Get the document Y index into this page.

public int
public boolean
isFootnoteReserved(CssContext c)

If this page is reserved for footnote content.

public boolean
public boolean
public void
private void
public void
paintBackground(RenderingContext c, int additionalClearance, short mode)

public void
paintBorder(RenderingContext c, int additionalClearance, short mode)

public void
paintMarginAreas(RenderingContext c, int additionalClearance, short mode)

private int
resolveAutoPageHeight(CssContext cssCtx)

Return the default page height if defined, else A4.

private int
resolveAutoPageWidth(CssContext cssCtx)

Returns the default page width if defined, else the A4 page size width

Note

We previously returned different sizes based on locale, but this could lead to different results between developement machines and servers so we now always return A4.

private void
private void
public void
public void
setFootnoteAreaHeight(int footnoteAreaHeight)

Sets the footnote area height on this page.

public void
setOuterPageWidth(int containingBlockWidth)

public void
public void
setPageNo(int pageNo)

public void
setPaintingBottom(int paintingBottom)

public void
setPaintingTop(int paintingTop)

public void
public void
public void
setTopAndBottom(CssContext cssCtx, int top)

public boolean
shouldInsertPages()

Should shadow pages be inserted for cut off content for this page.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait