org.apache.fop.render.pdf
Class PDFRenderer

java.lang.Object
  |
  +--org.apache.fop.render.pdf.PDFRenderer

public class PDFRenderer
extends java.lang.Object
implements Renderer

Renderer that renders areas to PDF


Field Summary
protected  float currentBlue
          the current colour's blue component
protected  PDFPathPaint currentFill
          the current color/gradient to fill shapes with
protected  java.lang.String currentFontName
          the current (internal) font name
protected  int currentFontSize
          the current font size in millipoints
protected  float currentGreen
          the current colour's green component
protected  float currentRed
          the current colour's red component
protected  PDFPathPaint currentStroke
          the current color/gradient for borders, letters, etc.
protected  int currentXPosition
          the current horizontal position in millipoints from left
protected  int currentYPosition
          the current vertical position in millipoints from bottom
protected  IDReferences idReferences
          the IDReferences for this document
protected  PDFDocument pdfDoc
          the PDF Document being created
protected  PDFResources pdfResources
          the /Resources object of the PDF document being created
 
Constructor Summary
PDFRenderer()
          create the PDF renderer
 
Method Summary
protected  void addLine(int x1, int y1, int x2, int y2, int th, PDFPathPaint stroke)
          add a line to the current stream
protected  void addLine(int x1, int y1, int x2, int y2, int th, java.lang.String rs, PDFPathPaint stroke)
          add a line to the current stream
protected  void addRect(int x, int y, int w, int h, PDFPathPaint stroke)
          add a rectangle to the current stream
protected  void addRect(int x, int y, int w, int h, PDFPathPaint stroke, PDFPathPaint fill)
          add a filled rectangle to the current stream
 void render(AreaTree areaTree, java.io.OutputStream stream)
          render the areas into PDF
 void renderAreaContainer(AreaContainer area)
          render area container to PDF
 void renderBlockArea(BlockArea area)
          render block area to PDF
 void renderBodyAreaContainer(BodyAreaContainer area)
          render the given area container
 void renderDisplaySpace(DisplaySpace space)
          render display space to PDF
 void renderForeignObjectArea(ForeignObjectArea area)
          render a foreign object area
 void renderImageArea(ImageArea area)
          render image area to PDF
 void renderInlineSpace(InlineSpace space)
          render inline space to PDF
 void renderLeaderArea(LeaderArea area)
          render leader area into PDF
 void renderLineArea(LineArea area)
          render line area to PDF
 void renderPage(Page page)
          render page into PDF
protected  void renderRootExtensions(AreaTree areaTree)
           
 void renderSpanArea(SpanArea area)
          render the given span area
 void renderSVGArea(SVGArea area)
          render SVG area to PDF
 void renderWordArea(WordArea area)
          render inline area to PDF
 void setProducer(java.lang.String producer)
          set the PDF document's producer
 void setupFontInfo(FontInfo fontInfo)
          set up the font info
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pdfDoc

protected PDFDocument pdfDoc
the PDF Document being created

pdfResources

protected PDFResources pdfResources
the /Resources object of the PDF document being created

idReferences

protected IDReferences idReferences
the IDReferences for this document

currentFontName

protected java.lang.String currentFontName
the current (internal) font name

currentFontSize

protected int currentFontSize
the current font size in millipoints

currentStroke

protected PDFPathPaint currentStroke
the current color/gradient for borders, letters, etc.

currentFill

protected PDFPathPaint currentFill
the current color/gradient to fill shapes with

currentRed

protected float currentRed
the current colour's red component

currentGreen

protected float currentGreen
the current colour's green component

currentBlue

protected float currentBlue
the current colour's blue component

currentYPosition

protected int currentYPosition
the current vertical position in millipoints from bottom

currentXPosition

protected int currentXPosition
the current horizontal position in millipoints from left
Constructor Detail

PDFRenderer

public PDFRenderer()
create the PDF renderer
Method Detail

setProducer

public void setProducer(java.lang.String producer)
set the PDF document's producer
Specified by:
setProducer in interface Renderer
Parameters:
producer - string indicating application producing PDF

render

public void render(AreaTree areaTree,
                   java.io.OutputStream stream)
            throws java.io.IOException,
                   FOPException
render the areas into PDF
Specified by:
render in interface Renderer
Parameters:
areaTree - the laid-out area tree
stream - the OutputStream to write the PDF to

addLine

protected void addLine(int x1,
                       int y1,
                       int x2,
                       int y2,
                       int th,
                       PDFPathPaint stroke)
add a line to the current stream
Parameters:
x1 - the start x location in millipoints
y1 - the start y location in millipoints
x2 - the end x location in millipoints
y2 - the end y location in millipoints
th - the thickness in millipoints
r - the red component
g - the green component
b - the blue component

addLine

protected void addLine(int x1,
                       int y1,
                       int x2,
                       int y2,
                       int th,
                       java.lang.String rs,
                       PDFPathPaint stroke)
add a line to the current stream
Parameters:
x1 - the start x location in millipoints
y1 - the start y location in millipoints
x2 - the end x location in millipoints
y2 - the end y location in millipoints
th - the thickness in millipoints
rs - the rule style as String containing dashArray + dashPhase
r - the red component
g - the green component
b - the blue component

addRect

protected void addRect(int x,
                       int y,
                       int w,
                       int h,
                       PDFPathPaint stroke)
add a rectangle to the current stream
Parameters:
x - the x position of left edge in millipoints
y - the y position of top edge in millipoints
w - the width in millipoints
h - the height in millipoints
stroke - the stroke color/gradient

addRect

protected void addRect(int x,
                       int y,
                       int w,
                       int h,
                       PDFPathPaint stroke,
                       PDFPathPaint fill)
add a filled rectangle to the current stream
Parameters:
x - the x position of left edge in millipoints
y - the y position of top edge in millipoints
w - the width in millipoints
h - the height in millipoints
fill - the fill color/gradient
stroke - the stroke color/gradient

renderAreaContainer

public void renderAreaContainer(AreaContainer area)
render area container to PDF
Specified by:
renderAreaContainer in interface Renderer
Parameters:
area - the area container to render

renderBodyAreaContainer

public void renderBodyAreaContainer(BodyAreaContainer area)
Description copied from interface: Renderer
render the given area container
Specified by:
renderBodyAreaContainer in interface Renderer

renderSpanArea

public void renderSpanArea(SpanArea area)
Description copied from interface: Renderer
render the given span area
Specified by:
renderSpanArea in interface Renderer

renderBlockArea

public void renderBlockArea(BlockArea area)
render block area to PDF
Specified by:
renderBlockArea in interface Renderer
Parameters:
area - the block area to render

renderDisplaySpace

public void renderDisplaySpace(DisplaySpace space)
render display space to PDF
Specified by:
renderDisplaySpace in interface Renderer
Parameters:
space - the display space to render

renderImageArea

public void renderImageArea(ImageArea area)
render image area to PDF
Specified by:
renderImageArea in interface Renderer
Parameters:
area - the image area to render

renderForeignObjectArea

public void renderForeignObjectArea(ForeignObjectArea area)
render a foreign object area
Specified by:
renderForeignObjectArea in interface Renderer

renderSVGArea

public void renderSVGArea(SVGArea area)
render SVG area to PDF
Specified by:
renderSVGArea in interface Renderer
Parameters:
area - the SVG area to render

renderWordArea

public void renderWordArea(WordArea area)
render inline area to PDF
Specified by:
renderWordArea in interface Renderer
Parameters:
area - inline area to render

renderInlineSpace

public void renderInlineSpace(InlineSpace space)
render inline space to PDF
Specified by:
renderInlineSpace in interface Renderer
Parameters:
space - space to render

renderLineArea

public void renderLineArea(LineArea area)
render line area to PDF
Specified by:
renderLineArea in interface Renderer
Parameters:
area - area to render

renderPage

public void renderPage(Page page)
render page into PDF
Specified by:
renderPage in interface Renderer
Parameters:
page - page to render

renderLeaderArea

public void renderLeaderArea(LeaderArea area)
render leader area into PDF
Specified by:
renderLeaderArea in interface Renderer
Parameters:
area - area to render

setupFontInfo

public void setupFontInfo(FontInfo fontInfo)
set up the font info
Specified by:
setupFontInfo in interface Renderer
Parameters:
fontInfo - font info to set up

renderRootExtensions

protected void renderRootExtensions(AreaTree areaTree)


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