Class PrintRenderer

    • Field Detail

      • fontInfo

        protected FontInfo fontInfo
        Font configuration
      • embedFontInfoList

        protected java.util.List<EmbedFontInfo> embedFontInfoList
        list of fonts
    • Constructor Detail

      • PrintRenderer

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

      • addFontList

        public void addFontList​(java.util.List<EmbedFontInfo> fontList)
        Adds a font list to current list of fonts
        Parameters:
        fontList - a font info list
      • setFontList

        public void setFontList​(java.util.List<EmbedFontInfo> embedFontInfoList)
        Parameters:
        embedFontInfoList - list of available fonts
      • getFontList

        public java.util.List<EmbedFontInfo> getFontList()
        Returns:
        list of available embedded fonts
      • getInternalFontNameForArea

        protected java.lang.String getInternalFontNameForArea​(Area area)
        Returns the internal font key for a font triplet coming from the area tree
        Parameters:
        area - the area from which to retrieve the font triplet information
        Returns:
        the internal font key (F1, F2 etc.) or null if not found
      • getFontFromArea

        protected Font getFontFromArea​(Area area)
        Returns a Font object constructed based on the font traits in an area
        Parameters:
        area - the area from which to retrieve the font triplet information
        Returns:
        the requested Font instance or null if not found
      • instantiateRendererContext

        protected RendererContext instantiateRendererContext()
        Instantiates a RendererContext for an image
        Returns:
        a newly created RendererContext.
      • createRendererContext

        protected RendererContext createRendererContext​(int x,
                                                        int y,
                                                        int width,
                                                        int height,
                                                        java.util.Map foreignAttributes)
        Creates a RendererContext for an image.
        Parameters:
        x - the x coordinate (in millipoints)
        y - the y coordinate (in millipoints)
        width - the width of the image (in millipoints)
        height - the height of the image (in millipoints)
        foreignAttributes - a Map or foreign attributes, may be null
        Returns:
        the RendererContext
      • renderDocument

        public void renderDocument​(org.w3c.dom.Document doc,
                                   java.lang.String ns,
                                   java.awt.geom.Rectangle2D pos,
                                   java.util.Map foreignAttributes)
        Renders an XML document (SVG for example).
        Parameters:
        doc - the DOM Document containing the XML document to be rendered
        ns - the namespace URI for the XML document
        pos - the position for the generated graphic/image
        foreignAttributes - the foreign attributes containing rendering hints, or null
      • getFontInfo

        public FontInfo getFontInfo()
        Returns:
        the font info