Package com.helger.pdflayout.render
Class PageRenderContext
- java.lang.Object
-
- com.helger.pdflayout.render.PageRenderContext
-
@NotThreadSafe public final class PageRenderContext extends Object
This class contains the context for rendering a single element onto the PDF.- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description PageRenderContext(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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PDPageContentStreamWithCachegetContentStream()org.apache.pdfbox.pdmodel.PDDocumentgetDocument()ERenderingElementTypegetElementType()floatgetHeight()floatgetStartLeft()floatgetStartTop()floatgetWidth()StringtoString()
-
-
-
Constructor Detail
-
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 Detail
-
getElementType
@Nonnull public ERenderingElementType getElementType()
- Returns:
- The type of the element currently rendered. Never
null.
-
getContentStream
@Nonnull public PDPageContentStreamWithCache getContentStream()
- Returns:
- The current content stream to write to. Never
null.
-
getDocument
@Nonnull public org.apache.pdfbox.pdmodel.PDDocument 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
-
-