Package com.helger.pdflayout.base
Interface IPLRenderableObject<IMPLTYPE extends IPLRenderableObject<IMPLTYPE>>
-
- Type Parameters:
IMPLTYPE- Implementation type
- All Superinterfaces:
com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>,com.helger.commons.id.IHasID<String>,IPLHasOutline,IPLObject<IMPLTYPE>,IPLVisitable
- All Known Subinterfaces:
IPLBlockElement<IMPLTYPE>,IPLElement<IMPLTYPE>,IPLHasHorizontalAlignment<IMPLTYPE>,IPLHasVerticalAlignment<IMPLTYPE>,IPLInlineElement<IMPLTYPE>
- All Known Implementing Classes:
AbstractPLBlockElement,AbstractPLBox,AbstractPLElement,AbstractPLExternalLink,AbstractPLHBox,AbstractPLImage,AbstractPLInlineBox,AbstractPLInlineElement,AbstractPLRenderableObject,AbstractPLText,AbstractPLVBox,PLBox,PLBulletPointList,PLExternalLink,PLHBox,PLImage,PLPageBreak,PLSpacerX,PLSpacerY,PLStreamImage,PLTable,PLTableCell,PLTableRow,PLText,PLVBox
public interface IPLRenderableObject<IMPLTYPE extends IPLRenderableObject<IMPLTYPE>> extends IPLObject<IMPLTYPE>, IPLHasOutline
Base interface for a renderable PDF layout object.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default com.helger.commons.state.EChangebeforeRender(PagePreRenderContext aCtx)Called after the page was created but before the content stream is created.default floatgetPreparedHeight()SizeSpecgetPreparedSize()Get the prepared size of the object.default floatgetPreparedWidth()default floatgetRenderHeight()SizeSpecgetRenderSize()default floatgetRenderWidth()booleanisPrepared()SizeSpecprepare(PreparationContext aCtx)Prepare this element once for rendering.voidrender(PageRenderContext aCtx)Second step: perform.-
Methods inherited from interface com.helger.pdflayout.base.IPLHasOutline
getOutlineBottom, getOutlineLeft, getOutlineRight, getOutlineTop, getOutlineXSum, getOutlineYSum
-
Methods inherited from interface com.helger.pdflayout.base.IPLObject
getAsSplittable, getDebugID, hasID, isVertSplittable, setBasicDataFrom
-
Methods inherited from interface com.helger.pdflayout.base.IPLVisitable
visit
-
-
-
-
Method Detail
-
isPrepared
boolean isPrepared()
- Returns:
trueif this object was already prepared,falseotherwise.
-
getPreparedSize
@Nullable SizeSpec getPreparedSize()
Get the prepared size of the object. This is the minimum space the content of the object needs given the available size constraints. This does NOT consider min- and max-size.- Returns:
- The prepared size or
nullif this object was not yet prepared. - See Also:
isPrepared()
-
getPreparedWidth
default float getPreparedWidth()
- Returns:
- The prepared width.
- See Also:
getPreparedSize()
-
getPreparedHeight
default float getPreparedHeight()
- Returns:
- The prepared height.
- See Also:
getPreparedSize()
-
getRenderSize
@Nullable SizeSpec getRenderSize()
- Returns:
- The render size or
nullif this object was not yet prepared. The render size includes the min/max size. - See Also:
isPrepared()
-
getRenderWidth
default float getRenderWidth()
-
getRenderHeight
default float getRenderHeight()
-
prepare
@Nonnull SizeSpec prepare(@Nonnull PreparationContext aCtx)
Prepare this element once for rendering.- Parameters:
aCtx- The preparation context- Returns:
- The net size of the rendered object without margin, border and
margin. May not be
null. - See Also:
render(PageRenderContext)
-
beforeRender
@Nonnull default com.helger.commons.state.EChange beforeRender(@Nonnull PagePreRenderContext aCtx) throws IOException
Called after the page was created but before the content stream is created. This is e.g. used for images to create their XObjects upfront.- Parameters:
aCtx- The current page render context. Nevernull.- Returns:
EChange.CHANGEDif something changed. May not benull.- Throws:
IOException- In case of a PDFBox error
-
render
@Nonnegative void render(@Nonnull PageRenderContext aCtx) throws IOException
Second step: perform. This renders the previously prepared object to the PDF content stream present in the rendering context.- Parameters:
aCtx- Rendering context- Throws:
IOException- In case of a PDFBox error- See Also:
prepare(PreparationContext)
-
-