org.apache.fop.svg
Class PDFDocumentGraphics2D

java.lang.Object
  |
  +--java.awt.Graphics
        |
        +--java.awt.Graphics2D
              |
              +--org.apache.batik.ext.awt.g2d.AbstractGraphics2D
                    |
                    +--org.apache.fop.svg.PDFGraphics2D
                          |
                          +--org.apache.fop.svg.PDFDocumentGraphics2D

public class PDFDocumentGraphics2D
extends PDFGraphics2D

This class is a wrapper for the PDFGraphics2D that is used to create a full document around the pdf rendering from PDFGraphics2D.

Version:
$Id: PDFDocumentGraphics2D.java,v 1.4 2001/05/18 10:03:15 keiron Exp $
Author:
Keiron Liddle
See Also:
PDFGraphics2D

Fields inherited from class org.apache.fop.svg.PDFGraphics2D
currentFontName, currentFontSize, currentXPosition, currentYPosition, fontState, pdfDoc
 
Fields inherited from class org.apache.batik.ext.awt.g2d.AbstractGraphics2D
gc, textAsShapes
 
Constructor Summary
PDFDocumentGraphics2D(boolean textAsShapes, java.io.OutputStream stream, int width, int height)
          Create a new PDFDocumentGraphics2D.
PDFDocumentGraphics2D(PDFDocumentGraphics2D g)
          This constructor supports the create method
 
Method Summary
 java.awt.Graphics create()
          Creates a new Graphics object that is a copy of this Graphics object.
 void finish()
          The rendering process has finished.
 void setBackgroundColor(java.awt.Color col)
          Set the background of the pdf document.
 void setGraphicContext(org.apache.batik.ext.awt.g2d.GraphicContext c)
           
 void setSVGDimension(float w, float h)
          Set the dimensions of the svg document that will be drawn.
 
Methods inherited from class org.apache.fop.svg.PDFGraphics2D
applyPaint, applyStroke, buildBufferedImage, copyArea, dispose, doDrawing, draw, drawImage, drawImage, drawRenderableImage, drawRenderedImage, drawString, drawString, fill, getDeviceConfiguration, getFontMetrics, getString, setXORMode, writeClip
 
Methods inherited from class org.apache.batik.ext.awt.g2d.AbstractGraphics2D
addRenderingHints, clearRect, clip, clipRect, drawArc, drawGlyphVector, drawImage, drawImage, drawImage, drawImage, drawImage, drawImage, drawLine, drawOval, drawPolygon, drawPolyline, drawRect, drawRoundRect, drawString, drawString, fillArc, fillOval, fillPolygon, fillRect, fillRoundRect, getBackground, getClip, getClipBounds, getColor, getComposite, getFont, getFontRenderContext, getPaint, getRenderingHint, getRenderingHints, getStroke, getTransform, hit, rotate, rotate, scale, setBackground, setClip, setClip, setColor, setComposite, setFont, setPaint, setPaintMode, setRenderingHint, setRenderingHints, setStroke, setTransform, shear, transform, translate, translate
 
Methods inherited from class java.awt.Graphics2D
draw3DRect, fill3DRect
 
Methods inherited from class java.awt.Graphics
create, drawBytes, drawChars, drawPolygon, fillPolygon, finalize, getClipBounds, getClipRect, getFontMetrics, hitClip, toString
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PDFDocumentGraphics2D

public PDFDocumentGraphics2D(boolean textAsShapes,
                             java.io.OutputStream stream,
                             int width,
                             int height)
Create a new PDFDocumentGraphics2D. This is used to create a new pdf document of the given height and width. The resulting document is written to the stream after rendering.
Parameters:
textAsShapes - set this to true so that text will be rendered using curves and not the font.
stream - the stream that the final document should be written to.
width - the width of the document
height - the height of the document

PDFDocumentGraphics2D

public PDFDocumentGraphics2D(PDFDocumentGraphics2D g)
This constructor supports the create method
Method Detail

setSVGDimension

public void setSVGDimension(float w,
                            float h)
Set the dimensions of the svg document that will be drawn. This is useful if the dimensions of the svg document are different from the pdf document that is to be created. The result is scaled so that the svg fits correctly inside the pdf document.

setBackgroundColor

public void setBackgroundColor(java.awt.Color col)
Set the background of the pdf document. This is used to set the background for the pdf document Rather than leaving it as the default white.

finish

public void finish()
            throws java.io.IOException
The rendering process has finished. This should be called after the rendering has completed as there is no other indication it is complete. This will then write the results to the output stream.

setGraphicContext

public void setGraphicContext(org.apache.batik.ext.awt.g2d.GraphicContext c)
Overrides:
setGraphicContext in class PDFGraphics2D

create

public java.awt.Graphics create()
Creates a new Graphics object that is a copy of this Graphics object.
Overrides:
create in class PDFGraphics2D
Returns:
a new graphics context that is a copy of this graphics context.


Copyright © 1999-2001 Apache Software Foundation. All Rights Reserved.