Class SvgImageRenderer

All Implemented Interfaces:
IPropertyContainer, ILeafElementRenderer, IRenderer

public class SvgImageRenderer extends ImageRenderer
Represents a renderer for the SvgImage layout element.
  • Constructor Details

    • SvgImageRenderer

      public SvgImageRenderer (SvgImage image)
      Creates an SvgImageRenderer from its corresponding layout object.
      Parameters:
      image - the SvgImage which this object should manage
  • Method Details

    • layout

      public LayoutResult layout (LayoutContext layoutContext)
      Description copied from interface: IRenderer
      This method simulates positioning of the renderer, including all of its children, and returns the LayoutResult, representing the layout result, including occupied area, status, i.e. if there was enough place to fit the renderer subtree, etc. LayoutResult can be extended to return custom layout results for custom elements, e.g. TextRenderer uses TextLayoutResult as its result. This method can be called standalone to learn how much area the renderer subtree needs, or can be called before IRenderer.draw(DrawContext), to prepare the renderer to be flushed to the output stream.
      Specified by:
      layout in interface IRenderer
      Overrides:
      layout in class ImageRenderer
      Parameters:
      layoutContext - the description of layout area and any other additional information
      Returns:
      result of the layout process
    • draw

      public void draw (DrawContext drawContext)
      Flushes the renderer subtree contents, i.e. draws itself on canvas, adds necessary objects to the PdfDocument etc.
      Specified by:
      draw in interface IRenderer
      Overrides:
      draw in class ImageRenderer
      Parameters:
      drawContext - contains the PdfDocument to which the renderer subtree if flushed, the PdfCanvas on which the renderer subtree is drawn and other additional parameters needed to perform drawing