|
fop 0.92beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.fop.render.AbstractRenderer | +--org.apache.fop.render.PrintRenderer | +--org.apache.fop.render.AbstractPathOrientedRenderer | +--org.apache.fop.render.pdf.PDFRenderer
Renderer that renders areas to PDF
Field Summary | |
protected java.awt.geom.AffineTransform |
currentBasicTransform
The current Transform |
protected PDFResourceContext |
currentContext
the current annotation list to add annotations to |
protected java.lang.String |
currentFontName
Name of currently selected font |
protected int |
currentFontSize
Size of currently selected font |
protected PDFPage |
currentPage
the current page to add annotations to |
protected PDFState |
currentState
drawing state |
protected PDFStream |
currentStream
the current stream to add PDF commands to |
static java.lang.String |
ENCRYPTION_PARAMS
PDF encryption parameter: all parameters as object, datatype: PDFEncryptionParams |
protected PDFEncryptionParams |
encryptionParams
the (optional) encryption parameters |
protected java.util.Map |
filterMap
Registry of PDF filters |
protected boolean |
inTextMode
true if a BT command has been written. |
static java.lang.String |
MIME_TYPE
The mime type for pdf |
static java.lang.String |
NO_ANNOTATIONS
PDF encryption parameter: Forbids annotations, datatype: Boolean or "true"/"false" |
static java.lang.String |
NO_COPY_CONTENT
PDF encryption parameter: Forbids copying content, datatype: Boolean or "true"/"false" |
static java.lang.String |
NO_EDIT_CONTENT
PDF encryption parameter: Forbids editing content, datatype: Boolean or "true"/"false" |
static java.lang.String |
NO_PRINT
PDF encryption parameter: Forbids printing, datatype: Boolean or "true"/"false" |
protected java.io.OutputStream |
ostream
The output stream to write the document to |
static java.lang.String |
OWNER_PASSWORD
PDF encryption parameter: owner password, datatype: String |
protected int |
pageHeight
page height |
protected java.util.Map |
pageReferences
Page references are stored using the PageViewport as the key when a reference is made the PageViewport is used for pdf this means we need the pdf page reference |
protected java.util.Map |
pages
Map of pages using the PageViewport as the key this is used for prepared pages that cannot be immediately rendered |
static java.lang.String |
PDF_A_MODE
Rendering Options key for the PDF/A mode. |
protected PDFAMode |
pdfAMode
the PDF/A mode (Default: disabled) |
protected PDFDocument |
pdfDoc
the PDF Document being created |
protected PDFResources |
pdfResources
the /Resources object of the PDF document being created |
protected java.util.Map |
pvReferences
Page viewport references |
static java.lang.String |
USER_PASSWORD
PDF encryption parameter: user password, datatype: String |
protected static boolean |
WRITE_COMMENTS
Controls whether comments are written to the PDF stream. |
Fields inherited from class org.apache.fop.render.PrintRenderer |
fontInfo, fontList |
Fields inherited from class org.apache.fop.render.AbstractRenderer |
containingBPPosition, containingIPPosition, currentBPPosition, currentIPPosition, currentPageViewport, log, userAgent |
Fields inherited from interface org.apache.fop.render.Renderer |
ROLE |
Constructor Summary | |
PDFRenderer()
create the PDF renderer |
Method Summary | |
protected void |
beginTextObject()
Indicates the beginning of a text object. |
protected java.util.List |
breakOutOfStateStack()
Breaks out of the state stack to handle fixed block-containers. |
protected void |
clip()
Clip an area. |
protected void |
clipRect(float x,
float y,
float width,
float height)
Clip a rectangular area. write a clipping operation given coordinates in the current transform. |
protected void |
closePath()
Closes the current subpath by appending a straight line segment from the current point to the starting point of the subpath. |
protected void |
closeText()
Checks to see if we have some text rendering commands open still and writes out the TJ command to the stream if we do |
protected void |
comment(java.lang.String text)
writes out a comment. |
void |
configure(org.apache.avalon.framework.configuration.Configuration cfg)
Configure the PDF renderer. |
protected void |
drawBorderLine(float x1,
float y1,
float x2,
float y2,
boolean horz,
boolean startOrBefore,
int style,
ColorType col)
Draw a border segment of an XSL-FO style border. |
protected void |
drawImage(java.lang.String url,
java.awt.geom.Rectangle2D pos)
Draw an image at the indicated location. |
protected void |
endTextObject()
Indicates the end of a text object. |
protected void |
endVParea()
Signals exit from a viewport area. |
void |
escapeText(java.lang.String s,
int[] letterAdjust,
Font fs,
AbstractTextArea parentArea,
boolean useMultiByte,
java.lang.StringBuffer pdf)
Escapes text according to PDF rules. |
protected void |
fillRect(float x,
float y,
float w,
float h)
Fill a rectangular area. |
protected static java.lang.String |
format(float value)
Formats a float value (normally coordinates) as Strings. |
Graphics2DAdapter |
getGraphics2DAdapter()
|
java.lang.String |
getMimeType()
Get the MIME type of the renderer. |
protected void |
handleRegionTraits(RegionViewport region)
Handle the traits for a region This is used to draw the traits for the given page region. |
protected void |
lineTo(float x,
float y)
Appends a straight line segment from the current point to (x, y). |
protected void |
moveTo(float x,
float y)
Moves the current point to (x, y), omitting any connecting line segment. |
protected void |
placeImage(float x,
float y,
float w,
float h,
int xobj)
Places a previously registered image at a certain place on the page. |
void |
preparePage(PageViewport page)
The pdf page is prepared by making the page. |
void |
processOffDocumentItem(OffDocumentItem odi)
Tells the renderer to process an item not explicitly placed on the document (e.g., PDF bookmarks). |
protected void |
putImage(java.lang.String url,
java.awt.geom.Rectangle2D pos)
Adds a PDF XObject (a bitmap) to the PDF that will later be referenced. |
protected void |
renderBookmarkTree(BookmarkData bookmarks)
Renders a Bookmark-Tree object |
void |
renderDocument(org.w3c.dom.Document doc,
java.lang.String ns,
java.awt.geom.Rectangle2D pos)
Renders an XML document (SVG for example). |
void |
renderForeignObject(ForeignObject fo,
java.awt.geom.Rectangle2D pos)
Renders a foreign object area. |
void |
renderImage(Image image,
java.awt.geom.Rectangle2D pos)
Renders an image area. |
void |
renderInlineParent(InlineParent ip)
Render inline parent area. |
void |
renderLeader(Leader area)
Render leader area. |
protected void |
renderLineArea(LineArea line)
Renders a line area. |
void |
renderPage(PageViewport page)
This method creates a pdf stream for the current page uses it as the contents of a new page. |
void |
renderSpace(SpaceArea space)
Render the given SpaceArea. |
void |
renderText(TextArea text)
Render the given TextArea. |
void |
renderWord(WordArea word)
Render the given WordArea. |
protected void |
restoreGraphicsState()
Restores the last graphics state of the rendering engine. |
protected void |
restoreStateStackAfterBreakOut(java.util.List breakOutList)
Restores the state stack after a break out. |
protected void |
saveGraphicsState()
Saves the graphics state of the rendering engine. |
protected void |
setColor(java.awt.Color col,
boolean fill,
java.lang.StringBuffer pdf)
Establishes a new foreground or fill color. |
void |
setUserAgent(FOUserAgent agent)
Set the User Agent. |
void |
startPageSequence(LineArea seqTitle)
Start the next page sequence. |
void |
startRenderer(java.io.OutputStream stream)
Initiates the rendering phase. |
protected void |
startVParea(CTM ctm,
java.awt.geom.Rectangle2D clippingRect)
Establishes a new viewport area. |
void |
stopRenderer()
Signals the end of the rendering phase. |
boolean |
supportsOutOfOrder()
Check if this renderer supports out of order rendering. |
protected void |
updateColor(ColorType col,
boolean fill)
Establishes a new foreground or fill color. |
Methods inherited from class org.apache.fop.render.AbstractPathOrientedRenderer |
drawBackAndBorders, handleBlockTraits, renderBlockViewport, renderInlineAreaBackAndBorders, renderInlineBlockParent, renderInlineSpace, renderTextDecoration, renderViewport, toColor |
Methods inherited from class org.apache.fop.render.PrintRenderer |
getFontFromArea, getInternalFontNameForArea, lightenColor, setupFontInfo |
Methods inherited from class org.apache.fop.render.AbstractRenderer |
convertTitleToString, getCurrentPageViewport, getHandlerConfig, getImageAdapter, renderBeforeFloat, renderBlock, renderBlocks, renderBodyRegion, renderCharacter, renderContainer, renderFlow, renderFootnote, renderInlineArea, renderMainReference, renderPageAreas, renderRegion, renderRegionViewport, renderXML |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String MIME_TYPE
public static final java.lang.String ENCRYPTION_PARAMS
public static final java.lang.String USER_PASSWORD
public static final java.lang.String OWNER_PASSWORD
public static final java.lang.String NO_PRINT
public static final java.lang.String NO_COPY_CONTENT
public static final java.lang.String NO_EDIT_CONTENT
public static final java.lang.String NO_ANNOTATIONS
public static final java.lang.String PDF_A_MODE
protected static final boolean WRITE_COMMENTS
protected PDFDocument pdfDoc
protected PDFAMode pdfAMode
protected java.util.Map pages
protected java.util.Map pageReferences
protected java.util.Map pvReferences
protected java.io.OutputStream ostream
protected PDFResources pdfResources
protected PDFStream currentStream
protected PDFResourceContext currentContext
protected PDFPage currentPage
protected PDFEncryptionParams encryptionParams
protected java.awt.geom.AffineTransform currentBasicTransform
protected PDFState currentState
protected java.lang.String currentFontName
protected int currentFontSize
protected int pageHeight
protected java.util.Map filterMap
protected boolean inTextMode
Constructor Detail |
public PDFRenderer()
Method Detail |
public void configure(org.apache.avalon.framework.configuration.Configuration cfg) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in class AbstractRenderer
Configurable.configure(Configuration)
public void setUserAgent(FOUserAgent agent)
Renderer
setUserAgent
in class AbstractRenderer
Renderer.setUserAgent(FOUserAgent)
public void startRenderer(java.io.OutputStream stream) throws java.io.IOException
Renderer
startRenderer
in class AbstractRenderer
Renderer.startRenderer(OutputStream)
public void stopRenderer() throws java.io.IOException
Renderer
stopRenderer
in class AbstractRenderer
Renderer.stopRenderer()
public boolean supportsOutOfOrder()
AbstractRenderer
supportsOutOfOrder
in class AbstractRenderer
Renderer.supportsOutOfOrder()
public void processOffDocumentItem(OffDocumentItem odi)
Renderer
processOffDocumentItem
in class AbstractRenderer
Renderer.processOffDocumentItem(OffDocumentItem)
protected void renderBookmarkTree(BookmarkData bookmarks)
bookmarks
- the BookmarkData object containing all the Bookmark-Itemspublic Graphics2DAdapter getGraphics2DAdapter()
getGraphics2DAdapter
in class AbstractRenderer
Renderer.getGraphics2DAdapter()
protected void comment(java.lang.String text)
text
- text for the commentprotected void saveGraphicsState()
saveGraphicsState
in class AbstractPathOrientedRenderer
protected void restoreGraphicsState()
restoreGraphicsState
in class AbstractPathOrientedRenderer
protected void beginTextObject()
beginTextObject
in class AbstractPathOrientedRenderer
protected void endTextObject()
endTextObject
in class AbstractPathOrientedRenderer
public void startPageSequence(LineArea seqTitle)
startPageSequence
in class AbstractRenderer
seqTitle
- the title of the page sequencepublic void preparePage(PageViewport page)
preparePage
in class AbstractRenderer
page
- the page to preparepublic void renderPage(PageViewport page) throws java.io.IOException, FOPException
renderPage
in class AbstractRenderer
Renderer.renderPage(PageViewport)
protected void startVParea(CTM ctm, java.awt.geom.Rectangle2D clippingRect)
AbstractRenderer
startVParea
in class AbstractRenderer
AbstractRenderer.startVParea(CTM, Rectangle2D)
protected void endVParea()
AbstractRenderer
endVParea
in class AbstractRenderer
AbstractRenderer.endVParea()
protected void handleRegionTraits(RegionViewport region)
handleRegionTraits
in class AbstractPathOrientedRenderer
region
- the RegionViewport whose region is to be drawnprotected static final java.lang.String format(float value)
value
- the valueprotected void drawBorderLine(float x1, float y1, float x2, float y2, boolean horz, boolean startOrBefore, int style, ColorType col)
AbstractPathOrientedRenderer
drawBorderLine
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void clipRect(float x, float y, float width, float height)
clipRect
in class AbstractPathOrientedRenderer
x
- the x coordinatey
- the y coordinatewidth
- the width of the areaheight
- the height of the areaprotected void clip()
clip
in class AbstractPathOrientedRenderer
protected void moveTo(float x, float y)
moveTo
in class AbstractPathOrientedRenderer
x
- x coordinatey
- y coordinateprotected void lineTo(float x, float y)
lineTo
in class AbstractPathOrientedRenderer
x
- x coordinatey
- y coordinateprotected void closePath()
closePath
in class AbstractPathOrientedRenderer
protected void fillRect(float x, float y, float w, float h)
AbstractPathOrientedRenderer
fillRect
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer.fillRect(float, float, float, float)
protected java.util.List breakOutOfStateStack()
breakOutOfStateStack
in class AbstractPathOrientedRenderer
protected void restoreStateStackAfterBreakOut(java.util.List breakOutList)
restoreStateStackAfterBreakOut
in class AbstractPathOrientedRenderer
breakOutList
- the state stack to restore.protected void renderLineArea(LineArea line)
AbstractRenderer
A line area may have grouped styling for its children such as underline, background.
renderLineArea
in class AbstractRenderer
AbstractRenderer.renderLineArea(LineArea)
public void renderInlineParent(InlineParent ip)
renderInlineParent
in class AbstractPathOrientedRenderer
ip
- the inline parent areapublic void renderText(TextArea text)
AbstractRenderer
renderText
in class AbstractRenderer
AbstractRenderer.renderText(TextArea)
public void renderWord(WordArea word)
AbstractRenderer
renderWord
in class AbstractRenderer
AbstractRenderer.renderWord(WordArea)
public void renderSpace(SpaceArea space)
AbstractRenderer
renderSpace
in class AbstractRenderer
AbstractRenderer.renderSpace(SpaceArea)
public void escapeText(java.lang.String s, int[] letterAdjust, Font fs, AbstractTextArea parentArea, boolean useMultiByte, java.lang.StringBuffer pdf)
s
- Text to escapeletterAdjust
- an array of widths for letter adjustment (may be null)fs
- Font stateparentArea
- the parent text area to retrieve certain traits fromuseMultiByte
- Indicates the use of multi byte conventionpdf
- target buffer for the escaped textprotected void closeText()
protected void setColor(java.awt.Color col, boolean fill, java.lang.StringBuffer pdf)
col
- the color to applyfill
- true to set the fill color, false for the foreground colorpdf
- StringBuffer to write the PDF code to, if null, the code is
written to the current stream.protected void updateColor(ColorType col, boolean fill)
AbstractPathOrientedRenderer
updateColor
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
public void renderImage(Image image, java.awt.geom.Rectangle2D pos)
AbstractRenderer
renderImage
in class AbstractRenderer
AbstractRenderer.renderImage(Image, Rectangle2D)
protected void drawImage(java.lang.String url, java.awt.geom.Rectangle2D pos)
AbstractPathOrientedRenderer
drawImage
in class AbstractPathOrientedRenderer
AbstractPathOrientedRenderer
protected void putImage(java.lang.String url, java.awt.geom.Rectangle2D pos)
url
- URL of the bitmappos
- Position of the bitmapprotected void placeImage(float x, float y, float w, float h, int xobj)
x
- X coordinatey
- Y coordinatew
- width for imageh
- height for imagexobj
- object number of the referenced imagepublic void renderForeignObject(ForeignObject fo, java.awt.geom.Rectangle2D pos)
AbstractRenderer
renderForeignObject
in class AbstractRenderer
AbstractRenderer.renderForeignObject(ForeignObject, Rectangle2D)
public void renderDocument(org.w3c.dom.Document doc, java.lang.String ns, java.awt.geom.Rectangle2D pos)
doc
- DOM document representing the XML documentns
- Namespace for the documentpos
- Position on the pagepublic void renderLeader(Leader area)
renderLeader
in class AbstractRenderer
area
- the leader area to renderpublic java.lang.String getMimeType()
AbstractRenderer
getMimeType
in class AbstractRenderer
AbstractRenderer
|
fop 0.92beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |