fop 0.90alpha1

org.apache.fop.render.ps
Class PSSVGHandler

java.lang.Object
  extended byorg.apache.fop.render.ps.PSSVGHandler
All Implemented Interfaces:
XMLHandler

public class PSSVGHandler
extends java.lang.Object
implements XMLHandler

PostScript XML handler for SVG. Uses Apache Batik for SVG processing. This handler handles XML for foreign objects when rendering to PostScript. It renders SVG to the PostScript document using the PSGraphics2D. The properties from the PostScript renderer are subject to change.

Version:
$Id: PSSVGHandler.java 332549 2005-11-11 13:44:40Z jeremias $
Author:
Apache XML FOP Development Team

Nested Class Summary
static class PSSVGHandler.PSInfo
          PostScript information structure for drawing the XML document.
protected  class PSSVGHandler.SVGHandler
          This method is placed in an inner class so that we don't get class loading errors if batik is not present.
 
Field Summary
static java.lang.String PS_FONT_INFO
          The font information for the PostScript renderer.
static java.lang.String PS_GENERATOR
          The PostScript generator that is being used to drawn into.
static java.lang.String PS_HEIGHT
          The height of the SVG graphic.
static java.lang.String PS_WIDTH
          The width of the SVG graphic.
static java.lang.String PS_XPOS
          The x position that this is being drawn at.
static java.lang.String PS_YPOS
          The y position that this is being drawn at.
 
Fields inherited from interface org.apache.fop.render.XMLHandler
HANDLE_ALL
 
Constructor Summary
PSSVGHandler()
          Create a new PostScript XML handler for use by the PostScript renderer.
 
Method Summary
 java.lang.String getMimeType()
           
 java.lang.String getNamespace()
           
static PSSVGHandler.PSInfo getPSInfo(RendererContext context)
          Get the pdf information from the render context.
 void handleXML(RendererContext context, org.w3c.dom.Document doc, java.lang.String ns)
          Handle an external xml document inside a Foreign Object Area.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PS_GENERATOR

public static final java.lang.String PS_GENERATOR
The PostScript generator that is being used to drawn into.

See Also:
Constant Field Values

PS_FONT_INFO

public static final java.lang.String PS_FONT_INFO
The font information for the PostScript renderer.

See Also:
Constant Field Values

PS_WIDTH

public static final java.lang.String PS_WIDTH
The width of the SVG graphic.

See Also:
Constant Field Values

PS_HEIGHT

public static final java.lang.String PS_HEIGHT
The height of the SVG graphic.

See Also:
Constant Field Values

PS_XPOS

public static final java.lang.String PS_XPOS
The x position that this is being drawn at.

See Also:
Constant Field Values

PS_YPOS

public static final java.lang.String PS_YPOS
The y position that this is being drawn at.

See Also:
Constant Field Values
Constructor Detail

PSSVGHandler

public PSSVGHandler()
Create a new PostScript XML handler for use by the PostScript renderer.

Method Detail

handleXML

public void handleXML(RendererContext context,
                      org.w3c.dom.Document doc,
                      java.lang.String ns)
               throws java.lang.Exception
Description copied from interface: XMLHandler

Handle an external xml document inside a Foreign Object Area.

This may throw an exception if for some reason it cannot be handled. The caller is expected to deal with this exception.

The implementation may convert the XML document internally to another XML dialect (SVG, for example) and call renderXML() on the AbstractRenderer again (which can be retrieved through the RendererContext).

Specified by:
handleXML in interface XMLHandler
Parameters:
context - The RendererContext (contains the user agent)
doc - A DOM containing the foreign object to be processed
ns - The Namespace of the foreign object
Throws:
java.lang.Exception - If an error occurs during processing.
See Also:
XMLHandler

getPSInfo

public static PSSVGHandler.PSInfo getPSInfo(RendererContext context)
Get the pdf information from the render context.

Parameters:
context - the renderer context
Returns:
the pdf information retrieved from the context

getMimeType

public java.lang.String getMimeType()
Specified by:
getMimeType in interface XMLHandler
Returns:
the MIME type for which this XMLHandler was written
See Also:
XMLHandler.getMimeType()

getNamespace

public java.lang.String getNamespace()
Specified by:
getNamespace in interface XMLHandler
Returns:
the XML namespace for the XML dialect this XMLHandler supports, null if all XML content is handled by this instance.
See Also:
XMLHandler.getNamespace()

fop 0.90alpha1

Copyright 1999-2005 The Apache Software Foundation. All Rights Reserved.