|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.fop.render.AbstractRenderer
org.apache.fop.render.PrintRenderer
org.apache.fop.render.pdf.PDFRenderer
public class PDFRenderer
Renderer that renders areas to PDF.
Modified by Mark Lillywhite, mark-fop@inomial.com to use the new Renderer interface. The PDF renderer is by far the trickiest renderer and the best supported by FOP. It also required some reworking in the way that Pages, Catalogs and the Root object were written to the stream. The output document should now still be a 100% compatible PDF document, but the order of the document writing is significantly different. See also the changes to PDFPage, PDFPages and PDFRoot.
Field Summary | |
---|---|
protected List |
extensions
|
protected Map |
options
options |
protected PDFDocument |
pdfDoc
the PDF Document being created |
protected PDFResources |
pdfResources
the /Resources object of the PDF document being created |
Fields inherited from class org.apache.fop.render.PrintRenderer |
---|
currentFill, currentFontName, currentFontSize, currentStroke, fontInfo, prevLineThroughColor, prevLineThroughSize, prevLineThroughXEndPos, prevLineThroughYEndPos, prevOverlineColor, prevOverlineSize, prevOverlineXEndPos, prevOverlineYEndPos, prevUnderlineColor, prevUnderlineSize, prevUnderlineXEndPos, prevUnderlineYEndPos |
Fields inherited from class org.apache.fop.render.AbstractRenderer |
---|
currentAreaContainerXPosition, currentXPosition, currentYPosition, idReferences, log |
Constructor Summary | |
---|---|
PDFRenderer()
create the PDF renderer |
Method Summary | |
---|---|
protected void |
addFilledRect(int x,
int y,
int w,
int h,
PDFPathPaint fill)
add a filled rectangle to the current stream |
protected void |
addLine(int x1,
int y1,
int x2,
int y2,
int th,
int rs,
PDFPathPaint stroke)
add a line to the current stream |
protected void |
addLine(int x1,
int y1,
int x2,
int y2,
int th,
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 |
protected void |
drawImageClipped(int x,
int y,
int clipX,
int clipY,
int clipW,
int clipH,
FopImage image,
FontState fs)
Renders an image, clipping it as specified. |
protected void |
drawImageScaled(int x,
int y,
int w,
int h,
FopImage image,
FontState fs)
Renders an image, scaling it to the given width and height. |
void |
render(Page page,
OutputStream outputStream)
render page to PDF |
void |
renderForeignObjectArea(ForeignObjectArea area)
render a foreign object area |
void |
renderPage(Page page)
render page into PDF |
protected void |
renderRootExtensions(List extensions)
render root extensions such as outlines |
void |
renderSVGArea(SVGArea area)
render SVG area to PDF |
protected void |
renderSVGDocument(Document doc,
int x,
int y,
FontState fs)
render SVG document to PDF |
void |
renderWordArea(WordArea area)
render inline area to PDF |
void |
setOptions(Map options)
set up renderer options |
void |
setProducer(String producer)
set the PDF document's producer |
void |
startRenderer(OutputStream stream)
Starts the renderer |
void |
stopRenderer(OutputStream stream)
Called when the renderer has finished its work |
Methods inherited from class org.apache.fop.render.PrintRenderer |
---|
addFilledRect, addWordLines, doFrame, renderDisplaySpace, renderInlineSpace, renderLeaderArea, setupFontInfo |
Methods inherited from class org.apache.fop.render.AbstractRenderer |
---|
doBackground, drawImage, getIDReferences, renderAreaContainer, renderBlockArea, renderBodyAreaContainer, renderImageArea, renderLineArea, renderRegionAreaContainer, renderRegions, renderSpanArea, setLogger |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PDFDocument pdfDoc
protected PDFResources pdfResources
protected Map options
protected List extensions
Constructor Detail |
---|
public PDFRenderer()
Method Detail |
---|
public void setOptions(Map options)
options
- Options for the rendererpublic void setProducer(String producer)
setProducer
in interface Renderer
setProducer
in class PrintRenderer
producer
- string indicating application producing PDFpublic void startRenderer(OutputStream stream) throws IOException
startRenderer
in interface Renderer
startRenderer
in class PrintRenderer
stream
- OutputStream to be written to
IOException
- In case of an IO problempublic void stopRenderer(OutputStream stream) throws IOException
stopRenderer
in interface Renderer
stopRenderer
in class PrintRenderer
stream
- OutputStream to be written to
IOException
- In cas of an IO problemprotected void addLine(int x1, int y1, int x2, int y2, int th, PDFPathPaint stroke)
addLine
in class PrintRenderer
x1
- the start x location in millipointsy1
- the start y location in millipointsx2
- the end x location in millipointsy2
- the end y location in millipointsth
- the thickness in millipointsstroke
- the stroke color/gradientprotected void addLine(int x1, int y1, int x2, int y2, int th, int rs, PDFPathPaint stroke)
addLine
in class PrintRenderer
x1
- the start x location in millipointsy1
- the start y location in millipointsx2
- the end x location in millipointsy2
- the end y location in millipointsth
- the thickness in millipointsrs
- the rule stylestroke
- the stroke color/gradientprotected void addRect(int x, int y, int w, int h, PDFPathPaint stroke)
addRect
in class PrintRenderer
x
- the x position of left edge in millipointsy
- the y position of top edge in millipointsw
- the width in millipointsh
- the height in millipointsstroke
- the stroke color/gradientprotected void addRect(int x, int y, int w, int h, PDFPathPaint stroke, PDFPathPaint fill)
addRect
in class PrintRenderer
x
- the x position of left edge in millipointsy
- the y position of top edge in millipointsw
- the width in millipointsh
- the height in millipointsfill
- the fill color/gradientstroke
- the stroke color/gradientprotected void addFilledRect(int x, int y, int w, int h, PDFPathPaint fill)
addFilledRect
in class PrintRenderer
x
- the x position of left edge in millipointsy
- the y position of top edge in millipointsw
- the width in millipointsh
- the height in millipointsfill
- the fill color/gradientprotected void drawImageScaled(int x, int y, int w, int h, FopImage image, FontState fs)
drawImageScaled
in class AbstractRenderer
x
- the x position of left edge in millipointsy
- the y position of top edge in millipointsw
- the width in millipointsh
- the height in millipointsimage
- the image to be renderedfs
- the font state to use when rendering text in non-bitmapped
images.protected void drawImageClipped(int x, int y, int clipX, int clipY, int clipW, int clipH, FopImage image, FontState fs)
drawImageClipped
in class AbstractRenderer
x
- the x position of left edge in millipoints.y
- the y position of top edge in millipoints.clipX
- the left edge of the clip in millipointsclipY
- the top edge of the clip in millipointsclipW
- the clip width in millipointsclipH
- the clip height in millipointsfs
- the font state to use when rendering text in non-bitmapped
images.image
- the image to be paintedpublic void renderForeignObjectArea(ForeignObjectArea area)
renderForeignObjectArea
in interface Renderer
renderForeignObjectArea
in class PrintRenderer
area
- the foreign object area to be renderedpublic void renderSVGArea(SVGArea area)
renderSVGArea
in interface Renderer
renderSVGArea
in class PrintRenderer
area
- the SVG area to renderprotected void renderSVGDocument(Document doc, int x, int y, FontState fs)
doc
- the document to renderx
- the x offsety
- the y offsetfs
- the fontstate to usepublic void renderWordArea(WordArea area)
renderWordArea
in interface Renderer
renderWordArea
in class PrintRenderer
area
- inline area to renderpublic void render(Page page, OutputStream outputStream) throws FOPException, IOException
page
- the page renderoutputStream
- the target OutputStream
FOPException
- in case of an internal problem
IOException
- in case of an IO problempublic void renderPage(Page page)
renderPage
in interface Renderer
renderPage
in class PrintRenderer
page
- page to renderprotected void renderRootExtensions(List extensions)
exts
- the list of root extensions to process
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |