Package com.helger.pdflayout.render
Class PageRenderContext
java.lang.Object
com.helger.pdflayout.render.PageRenderContext
This class contains the context for rendering a single element onto the PDF.
- Author:
- Philip Helger
-
Constructor Summary
ConstructorsConstructorDescriptionPageRenderContext(ERenderingElementType eElementType, PDPageContentStreamWithCache aCS, float fStartLeft, float fStartTop, float fWidth, float fHeight) PageRenderContext(PageRenderContext aCtx, float fStartLeft, float fStartTop, float fWidth, float fHeight) -
Method Summary
-
Constructor Details
-
PageRenderContext
public PageRenderContext(@Nonnull PageRenderContext aCtx, float fStartLeft, float fStartTop, float fWidth, float fHeight) - Parameters:
aCtx- Context to copy settings from. May not benull.fStartLeft- Absolute page x-start position of the element. Does not contain margin, padding or border of the element to be rendered.fStartTop- Absolute page y-start position of the element. Does not contain margin, padding or border of the element to be rendered.fWidth- available width determined from the surrounding elementfHeight- available height determined from the surrounding element
-
PageRenderContext
public PageRenderContext(@Nonnull ERenderingElementType eElementType, @Nonnull PDPageContentStreamWithCache aCS, float fStartLeft, float fStartTop, float fWidth, float fHeight) - Parameters:
eElementType- Element type. May not benull.aCS- Page content stream. May not benull.fStartLeft- Absolute page x-start position of the element. Does not contain margin, padding or border of the element to be rendered.fStartTop- Absolute page y-start position of the element. Does not contain margin, padding or border of the element to be rendered.fWidth- available width determined from the surrounding elementfHeight- available height determined from the surrounding element
-
-
Method Details
-
getElementType
- Returns:
- The type of the element currently rendered. Never
null.
-
getContentStream
- Returns:
- The current content stream to write to. Never
null.
-
getDocument
- Returns:
- The underlying PDF document. Never
null.
-
getStartLeft
public float getStartLeft()- Returns:
- Absolute page x-start position. Does not contain margin, padding or border of the element to be rendered.
-
getStartTop
public float getStartTop()- Returns:
- Absolute page y-start position. Does not contain margin, padding or border of the element to be rendered.
-
getWidth
public float getWidth()- Returns:
- available width determined from the surrounding element
-
getHeight
public float getHeight()- Returns:
- available height determined from the surrounding element
-
toString
-