org.apache.fop.render.pdf
Class SVGRenderer


public class SVGRenderer

Renderer that renders SVG to PDF


Inner Class Summary
 (package private) classSVGRenderer.DrawingInstruction
           
 (package private) classSVGRenderer.SVGTextRenderer
          This class is used to handle the rendering of svg text.

Field Summary
 (package private) StringWritercurrentStream
          the current stream to add PDF commands to

Constructor Summary
SVGRenderer(FontState fs, PDFDocument doc, String font, int size, int xpos, int ypos)
          create the SVG renderer

Method Summary
 StringgetString()
           
 voidrenderElement(SVGElement area, int posx, int posy)
          Main rendering selection.
 voidrenderGArea(SVGGElement area, int posx, int posy)
           
 voidrenderImage(String href, float x, float y, float width, float height)
          Renders an svg image to the current stream.
 voidrenderText(SVGTextElementImpl tg, float x, float y, DrawingInstruction di)
          Todo: underline, linethrough, textpath

Field Detail

currentStream

StringWriter currentStream
the current stream to add PDF commands to
Constructor Detail

SVGRenderer

public SVGRenderer(FontState fs, PDFDocument doc, String font, int size, int xpos, int ypos)
create the SVG renderer
Method Detail

getString

public String getString()

renderElement

public void renderElement(SVGElement area, int posx, int posy)
Main rendering selection. This applies any transform and style and then calls the appropriate rendering method depending on the type of element.

renderGArea

public void renderGArea(SVGGElement area, int posx, int posy)

renderImage

public void renderImage(String href, float x, float y, float width, float height)
Renders an svg image to the current stream. This uses the FopImageFactory to load the image and then renders it.

renderText

public void renderText(SVGTextElementImpl tg, float x, float y, DrawingInstruction di)
Todo: underline, linethrough, textpath

Association Links

to Class org.apache.fop.pdf.PDFDocument

the PDF Document being created

to Class org.apache.fop.layout.FontState

to Class java.io.StringWriter

the current stream to add PDF commands to

to Class java.lang.String

the current (internal) font name

to Class org.apache.fop.pdf.PDFColor

the current colour for use in svg