Class PNGRenderer

  • All Implemented Interfaces:
    java.awt.print.Printable, Constants, Renderer

    public class PNGRenderer
    extends Java2DRenderer
    PNG Renderer This class actually does not render itself, instead it extends org.apache.fop.render.java2D.Java2DRenderer and just encode rendering results into PNG format using Batik's image codec
    • Field Detail

      • MIME_TYPE

        public static final java.lang.String MIME_TYPE
        The MIME type for png-Rendering
        See Also:
        Constant Field Values
    • Constructor Detail

      • PNGRenderer

        public PNGRenderer​(FOUserAgent userAgent)
        Parameters:
        userAgent - the user agent that contains configuration details. This cannot be null.
    • Method Detail

      • getMimeType

        public java.lang.String getMimeType()
        Get the MIME type of the renderer.
        Returns:
        The MIME type of the renderer, may return null if not applicable.
      • startRenderer

        public void startRenderer​(java.io.OutputStream outputStream)
                           throws java.io.IOException
        Initiates the rendering phase. This must only be called once for a rendering. If stopRenderer is called then this may be called again for a new document rendering.
        Specified by:
        startRenderer in interface Renderer
        Overrides:
        startRenderer in class Java2DRenderer
        Parameters:
        outputStream - The OutputStream to use for output
        Throws:
        java.io.IOException - If an I/O error occurs
      • stopRenderer

        public void stopRenderer()
                          throws java.io.IOException
        Signals the end of the rendering phase. The renderer should reset to an initial state and dispose of any resources for the completed rendering.
        Specified by:
        stopRenderer in interface Renderer
        Overrides:
        stopRenderer in class Java2DRenderer
        Throws:
        java.io.IOException - If an I/O error occurs
      • getCurrentOutputStream

        protected java.io.OutputStream getCurrentOutputStream​(int pageNumber)
                                                       throws java.io.IOException
        Returns the OutputStream corresponding to this page
        Parameters:
        pageNumber - 0-based page number
        Returns:
        the corresponding OutputStream
        Throws:
        java.io.IOException - In case of an I/O error