fop 0.90alpha1

org.apache.fop.render.pdf
Class PDFSVGHandler

java.lang.Object
  extended byorg.apache.fop.render.pdf.PDFSVGHandler
All Implemented Interfaces:
XMLHandler

public class PDFSVGHandler
extends java.lang.Object
implements XMLHandler

PDF XML handler for SVG (uses Apache Batik). This handler handles XML for foreign objects when rendering to PDF. It renders SVG to the PDF document using the PDFGraphics2D. The properties from the PDF renderer are subject to change.


Nested Class Summary
static class PDFSVGHandler.PDFInfo
          PDF information structure for drawing the XML document.
protected  class PDFSVGHandler.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 OUTPUT_STREAM
          The output stream that the document is being sent to.
static java.lang.String PDF_CONTEXT
          The current PDF page for page renference and as a resource context.
static java.lang.String PDF_DOCUMENT
          The PDF document that is being drawn into.
static java.lang.String PDF_FONT_INFO
          The current font information for the pdf renderer.
static java.lang.String PDF_FONT_NAME
          The current pdf font name.
static java.lang.String PDF_FONT_SIZE
          The current pdf font size.
static java.lang.String PDF_HEIGHT
          The height of the current pdf page.
static java.lang.String PDF_PAGE
          The current PDF page for page renference and as a resource context.
static java.lang.String PDF_STATE
          The current pdf state.
static java.lang.String PDF_STREAM
          The current PDF stream to draw directly to.
static java.lang.String PDF_WIDTH
          The width of the current pdf page.
static java.lang.String PDF_XPOS
          The x position that this is being drawn at.
static java.lang.String PDF_YPOS
          The y position that this is being drawn at.
 
Fields inherited from interface org.apache.fop.render.XMLHandler
HANDLE_ALL
 
Constructor Summary
PDFSVGHandler()
          Create a new PDF XML handler for use by the PDF renderer.
 
Method Summary
 java.lang.String getMimeType()
           
 java.lang.String getNamespace()
           
static PDFSVGHandler.PDFInfo getPDFInfo(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

PDF_DOCUMENT

public static final java.lang.String PDF_DOCUMENT
The PDF document that is being drawn into.

See Also:
Constant Field Values

OUTPUT_STREAM

public static final java.lang.String OUTPUT_STREAM
The output stream that the document is being sent to.

See Also:
Constant Field Values

PDF_STATE

public static final java.lang.String PDF_STATE
The current pdf state.

See Also:
Constant Field Values

PDF_PAGE

public static final java.lang.String PDF_PAGE
The current PDF page for page renference and as a resource context.

See Also:
Constant Field Values

PDF_CONTEXT

public static final java.lang.String PDF_CONTEXT
The current PDF page for page renference and as a resource context.

See Also:
Constant Field Values

PDF_STREAM

public static final java.lang.String PDF_STREAM
The current PDF stream to draw directly to.

See Also:
Constant Field Values

PDF_WIDTH

public static final java.lang.String PDF_WIDTH
The width of the current pdf page.

See Also:
Constant Field Values

PDF_HEIGHT

public static final java.lang.String PDF_HEIGHT
The height of the current pdf page.

See Also:
Constant Field Values

PDF_FONT_INFO

public static final java.lang.String PDF_FONT_INFO
The current font information for the pdf renderer.

See Also:
Constant Field Values

PDF_FONT_NAME

public static final java.lang.String PDF_FONT_NAME
The current pdf font name.

See Also:
Constant Field Values

PDF_FONT_SIZE

public static final java.lang.String PDF_FONT_SIZE
The current pdf font size.

See Also:
Constant Field Values

PDF_XPOS

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

See Also:
Constant Field Values

PDF_YPOS

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

See Also:
Constant Field Values
Constructor Detail

PDFSVGHandler

public PDFSVGHandler()
Create a new PDF XML handler for use by the PDF 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

getPDFInfo

public static PDFSVGHandler.PDFInfo getPDFInfo(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.