PSTranscoder (Apache FOP Core 2.11 API)
Date: 2025-04-24

org.apache.fop.render.ps

## Class PSTranscoder

- java.lang.Object
- - org.apache.batik.transcoder.TranscoderSupport
  - - org.apache.batik.transcoder.AbstractTranscoder
    - - org.apache.batik.transcoder.XMLAbstractTranscoder
      - - org.apache.batik.transcoder.SVGAbstractTranscoder
        - - org.apache.fop.svg.AbstractFOPTranscoder
          - - org.apache.fop.render.ps.AbstractPSTranscoder
            - - org.apache.fop.render.ps.PSTranscoder

- All Implemented Interfaces:
    org.apache.batik.transcoder.Transcoder, Configurable

      public class PSTranscoder
      extends AbstractPSTranscoder

  This class enables to transcode an input to a PostScript document.

  Two transcoding hints (`KEY_WIDTH` and `KEY_HEIGHT`) can be used to respectively specify the image width and the image height. If only one of these keys is specified, the transcoder preserves the aspect ratio of the original image.

  The `KEY_BACKGROUND_COLOR` defines the background color to use for opaque image formats, or the background color that may be used for image formats that support alpha channel.

  The `KEY_AOI` represents the area of interest to paint in device space.

  Three additional transcoding hints that act on the SVG processor can be specified:

  `KEY_LANGUAGE` to set the default language to use (may be used by a <switch> SVG element for example), `KEY_USER_STYLESHEET_URI` to fix the URI of a user stylesheet, and `KEY_PIXEL_TO_MM` to specify the pixel to millimeter conversion factor.

  This work was authored by Keiron Liddle (keiron@aftexsw.com).

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from class org.apache.fop.svg.AbstractFOPTranscoder

      `AbstractFOPTranscoder.FOPErrorHandler, AbstractFOPTranscoder.FOPTranscoderUserAgent`

    - ### Nested classes/interfaces inherited from class org.apache.batik.transcoder.SVGAbstractTranscoder

      `org.apache.batik.transcoder.SVGAbstractTranscoder.SVGAbstractTranscoderUserAgent`

  - ### Field Summary

    - ### Fields inherited from class org.apache.fop.render.ps.AbstractPSTranscoder

      `graphics`

    - ### Fields inherited from class org.apache.fop.svg.AbstractFOPTranscoder

      `KEY_AUTO_FONTS, KEY_DEVICE_RESOLUTION, KEY_STROKE_TEXT, VALUE_FORMAT_OFF, VALUE_FORMAT_ON`

    - ### Fields inherited from class org.apache.batik.transcoder.SVGAbstractTranscoder

      `builder, ctx, curAOI, curTxf, DEFAULT_ALLOWED_SCRIPT_TYPES, DEFAULT_DEFAULT_FONT_FAMILY, height, KEY_ALLOW_EXTERNAL_RESOURCES, KEY_ALLOWED_SCRIPT_TYPES, KEY_ALTERNATE_STYLESHEET, KEY_AOI, KEY_CONSTRAIN_SCRIPT_ORIGIN, KEY_DEFAULT_FONT_FAMILY, KEY_EXECUTE_ONLOAD, KEY_HEIGHT, KEY_LANGUAGE, KEY_MAX_HEIGHT, KEY_MAX_WIDTH, KEY_MEDIA, KEY_PIXEL_TO_MM, KEY_PIXEL_UNIT_TO_MILLIMETER, KEY_SNAPSHOT_TIME, KEY_USER_STYLESHEET_URI, KEY_WIDTH, root, userAgent, width`

    - ### Fields inherited from class org.apache.batik.transcoder.XMLAbstractTranscoder

      `KEY_DOCUMENT_ELEMENT, KEY_DOCUMENT_ELEMENT_NAMESPACE_URI, KEY_DOM_IMPLEMENTATION, KEY_XML_PARSER_CLASSNAME, KEY_XML_PARSER_VALIDATING`

    - ### Fields inherited from class org.apache.batik.transcoder.TranscoderSupport

      `handler, hints`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `PSTranscoder()` Constructs a new `PSTranscoder`.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D` | `createDocumentGraphics2D()` Creates the root Graphics2D instance for generating PostScript.

    - ### Methods inherited from class org.apache.fop.render.ps.AbstractPSTranscoder

      `createBridgeContext, createBridgeContext, getAutoFontsDefault, transcode`

    - ### Methods inherited from class org.apache.fop.svg.AbstractFOPTranscoder

      `configure, createDocumentFactory, createUserAgent, getDeviceResolution, getEffectiveConfiguration, getImageManager, getImageSessionContext, getLogger, isTextStroked, setEntityResolver, setLogger, setupImageInfrastructure`

    - ### Methods inherited from class org.apache.batik.transcoder.SVGAbstractTranscoder

      `createBridgeContext, getCanvasGraphicsNode, setImageSize, transcode`

    - ### Methods inherited from class org.apache.batik.transcoder.TranscoderSupport

      `addTranscodingHint, getErrorHandler, getTranscodingHints, removeTranscodingHint, setErrorHandler, setTranscodingHints, setTranscodingHints`

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

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

    - ### Methods inherited from interface org.apache.batik.transcoder.Transcoder

      `addTranscodingHint, getErrorHandler, getTranscodingHints, removeTranscodingHint, setErrorHandler, setTranscodingHints, setTranscodingHints`

- - ### Constructor Detail

    - #### PSTranscoder

          public PSTranscoder()

      Constructs a new `PSTranscoder`.

  - ### Method Detail

    - #### createDocumentGraphics2D

          protected org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D createDocumentGraphics2D()

      Creates the root Graphics2D instance for generating PostScript.
      Specified by:
        `createDocumentGraphics2D` in class `AbstractPSTranscoder`
      Returns:
        the root Graphics2D

Copyright © 2025 Apache Software Foundation. All rights reserved.