Package com.openhtmltopdf.render
Class RenderingContext
java.lang.Object
com.openhtmltopdf.render.RenderingContext
- All Implemented Interfaces:
CssContext
,Cloneable
Supplies information about the context in which rendering will take place
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate BidiReorderer
private boolean
private FontContext
private int
private boolean
private boolean
private OutputDevice
private PageBox
private int
private int
private Layer
private int
protected final SharedContext
-
Constructor Summary
ConstructorsConstructorDescriptionRenderingContext
(SharedContext sharedContext) needs a new instance every run -
Method Summary
Modifier and TypeMethodDescriptionclone()
boolean
boolean
boolean
boolean
getBoxById
(String id) getCss()
int
float
getDPI()
getFixedRectangle
(boolean excludeFloatBottomArea) Get the document (for non-paged docs) or page rect where fixed position boxes should be layed out.getFont
(FontSpecification font) float
getFSFontMetrics
(FSFont font) int
float
getPage()
int
int
int
getUac()
Get the viewport rect, for painting the body or html tag background.float
getXHeight
(FontSpecification parentFont) boolean
boolean
Returns true if we are laying out the footnote area rather than general content.boolean
boolean
boolean
isPaged()
Returns true if the currently set media type is paged.boolean
isPrint()
void
setBaseURL
(String url) void
void
setFastRenderer
(boolean isFast) void
setFontContext
(FontContext fontContext) void
setInitialPageNo
(int initialPageNo) void
setInPageMargins
(boolean inMargin) void
setIsInFloatBottom
(boolean inFloatBottom) void
setOutputDevice
(OutputDevice outputDevice) void
void
setPageCount
(int pageCount) void
setRootLayer
(Layer rootLayer) void
setShadowPageNumber
(int shadow)
-
Field Details
-
outputDevice
-
fontContext
-
pageCount
private int pageCount -
pageNo
private int pageNo -
page
-
shadowPageNumber
private int shadowPageNumber -
rootLayer
-
initialPageNo
private int initialPageNo -
isFastRenderer
private boolean isFastRenderer -
inPageMargins
private boolean inPageMargins -
_isInFloatBottom
private boolean _isInFloatBottom -
_bidi
-
Constructor Details
-
Method Details
-
isFastRenderer
public boolean isFastRenderer() -
setFastRenderer
public void setFastRenderer(boolean isFast) -
setBaseURL
-
getUac
-
getBaseURL
-
getDPI
public float getDPI() -
getMmPerDot
public float getMmPerDot()- Specified by:
getMmPerDot
in interfaceCssContext
-
getDotsPerPixel
public int getDotsPerPixel()- Specified by:
getDotsPerPixel
in interfaceCssContext
-
getFontSize2D
- Specified by:
getFontSize2D
in interfaceCssContext
-
getXHeight
- Specified by:
getXHeight
in interfaceCssContext
-
getTextRenderer
- Specified by:
getTextRenderer
in interfaceCssContext
-
setBidiReorderer
-
getBidiReorderer
-
isPaged
public boolean isPaged()Returns true if the currently set media type is paged. Currently returns true only for print , projection , and embossed , handheld , and tv . See the media section of the CSS 2.1 spec for more information on media types.- Returns:
- The paged value
-
getFontResolver
-
getFont
- Specified by:
getFont
in interfaceCssContext
-
getCanvas
-
getFixedRectangle
Get the document (for non-paged docs) or page rect where fixed position boxes should be layed out. Generally we want to setexcludeFloatBottomArea
true so fixed content doesn't sit above footnotes. -
getViewportRectangle
Get the viewport rect, for painting the body or html tag background. -
debugDrawBoxes
public boolean debugDrawBoxes() -
debugDrawLineBoxes
public boolean debugDrawLineBoxes() -
debugDrawInlineBoxes
public boolean debugDrawInlineBoxes() -
debugDrawFontMetrics
public boolean debugDrawFontMetrics() -
isInteractive
public boolean isInteractive() -
isPrint
public boolean isPrint() -
getOutputDevice
-
setOutputDevice
-
getFontContext
- Specified by:
getFontContext
in interfaceCssContext
-
setFontContext
-
setPage
-
getPageCount
public int getPageCount() -
setPageCount
public void setPageCount(int pageCount) -
getPage
-
getPageNo
public int getPageNo() -
getCss
- Specified by:
getCss
in interfaceCssContext
-
getFSFontMetrics
- Specified by:
getFSFontMetrics
in interfaceCssContext
-
getRootLayer
-
setRootLayer
-
getInitialPageNo
public int getInitialPageNo() -
setInitialPageNo
public void setInitialPageNo(int initialPageNo) -
getBoxById
-
setShadowPageNumber
public void setShadowPageNumber(int shadow) -
getShadowPageNumber
public int getShadowPageNumber()- Returns:
- overflow page number or -1 if this is not an overflow page.
-
setInPageMargins
public void setInPageMargins(boolean inMargin) -
isInPageMargins
public boolean isInPageMargins() -
clone
-
setIsInFloatBottom
public void setIsInFloatBottom(boolean inFloatBottom) -
isInFloatBottom
public boolean isInFloatBottom()Returns true if we are laying out the footnote area rather than general content.- Specified by:
isInFloatBottom
in interfaceCssContext
-