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 Details

    • isPrepared

      boolean isPrepared()
      Returns:
      true if this object was already prepared, false otherwise.
    • 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 null if this object was not yet prepared.
      See Also:
    • getPreparedWidth

      default float getPreparedWidth()
      Returns:
      The prepared width.
      See Also:
    • getPreparedHeight

      default float getPreparedHeight()
      Returns:
      The prepared height.
      See Also:
    • getRenderSize

      @Nullable SizeSpec getRenderSize()
      Returns:
      The render size or null if this object was not yet prepared. The render size includes the min/max size.
      See Also:
    • getRenderWidth

      default float getRenderWidth()
    • getRenderHeight

      default float getRenderHeight()
    • prepare

      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:
    • 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. Never null.
      Returns:
      EChange.CHANGED if something changed. May not be null.
      Throws:
      IOException - In case of a PDFBox error
    • render

      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: