org.apache.fop.render

## Class PrintRendererConfigurator

- java.lang.Object
- - org.apache.fop.render.AbstractRendererConfigurator
  - - org.apache.fop.render.PrintRendererConfigurator

- All Implemented Interfaces:
    IFDocumentHandlerConfigurator
  Direct Known Subclasses:
    AFPRendererConfigurator, DefaultRendererConfigurator, PCLRendererConfigurator

      public abstract class PrintRendererConfigurator
      extends AbstractRendererConfigurator
      implements IFDocumentHandlerConfigurator

  Base Print renderer configurator (mostly handles font configuration)

- - ### Field Summary

    - ### Fields inherited from class org.apache.fop.render.AbstractRendererConfigurator

      `userAgent`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PrintRendererConfigurator(FOUserAgent userAgent, RendererConfig.RendererConfigParser rendererConfigParser)` Default constructor
    `PrintRendererConfigurator(FOUserAgent userAgent, RendererConfig.RendererConfigParser rendererConfigParser, FontConfigurator<EmbedFontInfo> fontInfoConfigurator)` Default constructor

  - ### Method Summary

    All Methods Static Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `configure(IFDocumentHandler documentHandler)` Configures a intermediate format document handler.
    `void` | `configure(Renderer renderer)` Builds a list of EmbedFontInfo objects for use with the setup() method.
    `protected FontCollection` | `createCollectionFromFontList(InternalResourceResolver resolver, List<EmbedFontInfo> fontList)` Creates the font collection given a list of embedded font infomation.
    `static PrintRendererConfigurator` | `createDefaultInstance(FOUserAgent userAgent)`
    `protected FontCollection` | `getCustomFontCollection(InternalResourceResolver resolver, String mimeType)` Returns the font collection for custom configured fonts.
    `protected abstract List<FontCollection>` | `getDefaultFontCollection()`
    `protected RendererConfig` | `getRendererConfig(IFDocumentHandler documentHandler)` Returns the renderer configuration data for a specific renderer.
    `protected RendererConfig` | `getRendererConfig(Renderer renderer)` gets the renderer configuration data for a specific renderer.
    `protected RendererConfig` | `getRendererConfig(String mimeType)` gets the renderer configuration data for a specific renderer.
    `void` | `setupFontInfo(String mimeType, FontInfo fontInfo)` Sets up the `FontInfo` object for the IFDocumentHandler.

    - ### Methods inherited from class org.apache.fop.render.AbstractRendererConfigurator

      `getType`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### PrintRendererConfigurator

          public PrintRendererConfigurator(FOUserAgent userAgent,
                                           RendererConfig.RendererConfigParser rendererConfigParser)

      Default constructor
      Parameters:
        `userAgent` - user agent

    - #### PrintRendererConfigurator

          public PrintRendererConfigurator(FOUserAgent userAgent,
                                           RendererConfig.RendererConfigParser rendererConfigParser,
                                           FontConfigurator<EmbedFontInfo> fontInfoConfigurator)

      Default constructor
      Parameters:
        `userAgent` - user agent

  - ### Method Detail

    - #### getRendererConfig

          protected RendererConfig getRendererConfig(IFDocumentHandler documentHandler)
                                              throws FOPException

      Returns the renderer configuration data for a specific renderer.
      Parameters:
        `documentHandler` - the document handler
      Returns:
        the renderer configuration data
      Throws:
        `FOPException` - if an error occurs

    - #### getRendererConfig

          protected RendererConfig getRendererConfig(String mimeType)
                                              throws FOPException

      gets the renderer configuration data for a specific renderer.
      Parameters:
        `mimeType` - the MIME type
      Returns:
        the renderer configuration data
      Throws:
        `FOPException` - if an error occurs

    - #### getRendererConfig

          protected RendererConfig getRendererConfig(Renderer renderer)
                                              throws FOPException

      gets the renderer configuration data for a specific renderer.
      Parameters:
        `renderer` - the renderer
      Returns:
        the renderer configuration data
      Throws:
        `FOPException` - if an error occurs

    - #### configure

          public void configure(Renderer renderer)
                         throws FOPException

      Builds a list of EmbedFontInfo objects for use with the setup() method.
      Parameters:
        `renderer` - print renderer
      Throws:
        `FOPException` - if something's wrong with the config data

    - #### configure

          public void configure(IFDocumentHandler documentHandler)
                         throws FOPException

      Configures a intermediate format document handler.
      Specified by:
        `configure` in interface `IFDocumentHandlerConfigurator`
      Parameters:
        `documentHandler` - the document handler instance
      Throws:
        `FOPException` - if an error occurs while configuring the object

    - #### setupFontInfo

          public void setupFontInfo(String mimeType,
                                    FontInfo fontInfo)
                             throws FOPException

      Sets up the `FontInfo` object for the IFDocumentHandler.
      Specified by:
        `setupFontInfo` in interface `IFDocumentHandlerConfigurator`
      Parameters:
        `mimeType` - the MIME type of the document handler
        `fontInfo` - the font info object to set up
      Throws:
        `FOPException` - if an error occurs while configuring the object

    - #### getDefaultFontCollection

          protected abstract List<FontCollection> getDefaultFontCollection()

    - #### getCustomFontCollection

          protected FontCollection getCustomFontCollection(InternalResourceResolver resolver,
                                                           String mimeType)
                                                    throws FOPException

      Returns the font collection for custom configured fonts.
      Parameters:
        `resolver` - the resource resolver
        `mimeType` - the renderer MIME type
      Returns:
        the font collection
      Throws:
        `FOPException` - if an error occurs

    - #### createCollectionFromFontList

          protected FontCollection createCollectionFromFontList(InternalResourceResolver resolver,
                                                                List<EmbedFontInfo> fontList)

      Creates the font collection given a list of embedded font infomation.
      Parameters:
        `resolver` - the resource resolver
        `fontList` - the embedded font infomation
      Returns:
        the font collection

    - #### createDefaultInstance

          public static PrintRendererConfigurator createDefaultInstance(FOUserAgent userAgent)

Copyright © 2025 Apache Software Foundation. All rights reserved.