public class AFPDataStream
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log
Static logging instance
|
Constructor and Description |
---|
AFPDataStream()
Default constructor for the AFPDataStream.
|
Modifier and Type | Method and Description |
---|---|
void |
createFont(byte fontReference,
AFPFont font,
int size)
Helper method to create a map coded font object on the current page, this
method delegates the construction of the map coded font object to the
active environment group on the current page.
|
void |
createIncludePageOverlay(java.lang.String name)
Helper method which allows creation of the MPO object, via the AEG.
|
void |
createIncludePageSegment(java.lang.String name,
int x,
int y)
Creates an IncludePageSegment on the current page.
|
void |
createInvokeMediumMap(java.lang.String name)
Helper method which allows creation of the IMM object.
|
void |
createLine(int x1,
int y1,
int x2,
int y2,
int thickness,
java.awt.Color col)
Method to create a line on the current page.
|
void |
createNoOperation(java.lang.String content)
Creates a NoOperation item
|
void |
createPageGroupTagLogicalElement(TagLogicalElementBean[] attributes)
Creates a TagLogicalElement on the current page group.
|
void |
createPageTagLogicalElement(TagLogicalElementBean[] attributes)
Creates a TagLogicalElement on the current page.
|
void |
createShading(int x,
int y,
int w,
int h,
int red,
int green,
int blue)
This method will create shading on the page using the specified
coordinates (the shading contrast is controlled via the red, green, blue
parameters, by converting this to grey scale).
|
void |
createTagLogicalElement(java.lang.String name,
java.lang.String value)
Creates a TagLogicalElement on the current page or page group
|
void |
createText(int fontNumber,
int x,
int y,
java.awt.Color col,
int vsci,
int ica,
byte[] data)
Helper method to create text on the current page, this method delegates
to the current presentation text object in order to construct the text.
|
void |
endDocument()
The document is ended by invoking this method which creates an instance
of the AFP Document object and registers the start with a validation map
which ensures that methods are not invoked out of the correct sequence.
|
void |
endOverlay()
Helper method to mark the end of the current overlay.
|
void |
endPage()
Helper method to mark the end of the current page.
|
void |
endPageGroup()
Helper method to mark the end of the page group.
|
ImageObject |
getImageObject(int x,
int y,
int w,
int h,
int wr,
int hr)
Returns an ImageObject used to create an image in the datastream.
|
void |
restorePage(PageObject pageObject)
Helper method to restore the current page.
|
PageObject |
savePage()
Helper method to save the current page.
|
void |
setLandscapeRotation(int pageRotation)
Sets the rotation to be used for landscape pages, valid values are 0, 90,
180, 270 (default).
|
void |
setOffsets(int xOff,
int yOff,
int rot)
Sets the offsets to be used for element positioning
|
void |
setPortraitRotation(int pageRotation)
Sets the rotation to be used for portrait pages, valid values are 0
(default), 90, 180, 270.
|
void |
startDocument(java.io.OutputStream docOutputStream)
The document is started by invoking this method which creates an instance
of the AFP Document object.
|
void |
startOverlay(int overlayX,
int overlayY,
int overlayWidth,
int overlayHeight,
int overlayWidthResolution,
int overlayHeightResolution,
int overlayRotation)
Start a new overlay.
|
void |
startPage(int pageWidth,
int pageHeight,
int pageRotation,
int pageWidthResolution,
int pageHeightResolution)
Start a new page.
|
void |
startPageGroup()
Start a new page group.
|
public void startDocument(java.io.OutputStream docOutputStream)
docOutputStream
- the outputStream which the document is written to.public void endDocument() throws java.io.IOException
java.io.IOException
- throws an I/O exception of some sort has occurredpublic void startPage(int pageWidth, int pageHeight, int pageRotation, int pageWidthResolution, int pageHeightResolution)
endPage()
method must be invoked to mark the page ending.pageWidth
- the width of the pagepageHeight
- the height of the pagepageRotation
- the rotation of the pagepageWidthResolution
- the width resolution of the pagepageHeightResolution
- the height resolution of the pagepublic void startOverlay(int overlayX, int overlayY, int overlayWidth, int overlayHeight, int overlayWidthResolution, int overlayHeightResolution, int overlayRotation)
endOverlay()
method must be invoked to mark the overlay
ending.overlayX
- the x position of the overlay on the pageoverlayY
- the y position of the overlay on the pageoverlayWidth
- the width of the overlayoverlayHeight
- the height of the overlayoverlayWidthResolution
- the width resolution of the overlayoverlayHeightResolution
- the height resolution of the overlayoverlayRotation
- the rotation of the overlaypublic void endOverlay()
public PageObject savePage()
public void restorePage(PageObject pageObject)
pageObject
- page objectpublic void endPage() throws java.io.IOException
java.io.IOException
- thrown when an I/O exception of some sort has occurredpublic void setOffsets(int xOff, int yOff, int rot)
xOff
- the offset in the x directionyOff
- the offset in the y directionrot
- the rotationpublic void createFont(byte fontReference, AFPFont font, int size)
fontReference
- the font number used as the resource identifierfont
- the fontsize
- the point size of the fontpublic void createText(int fontNumber, int x, int y, java.awt.Color col, int vsci, int ica, byte[] data)
fontNumber
- the font number used as the resource identifierx
- the x coordinate of the texty
- the y coordinate of the textcol
- the text colorvsci
- The variable space character increment.ica
- The inter character adjustment.data
- the text data to createpublic ImageObject getImageObject(int x, int y, int w, int h, int wr, int hr)
x
- the x position of the imagey
- the y position of the imagew
- the width of the imageh
- the height of the imagewr
- the width resolution of the imagehr
- the height resolution of the imagepublic void createLine(int x1, int y1, int x2, int y2, int thickness, java.awt.Color col)
x1
- the first x coordinate of the liney1
- the first y coordinate of the linex2
- the second x coordinate of the liney2
- the second y coordinate of the linethickness
- the thickness of the linecol
- The text color.public void createShading(int x, int y, int w, int h, int red, int green, int blue)
x
- the x coordinate of the shadingy
- the y coordinate of the shadingw
- the width of the shaded areah
- the height of the shaded areared
- the red valuegreen
- the green valueblue
- the blue valuepublic void createIncludePageOverlay(java.lang.String name)
name
- the name of the static overlaypublic void createInvokeMediumMap(java.lang.String name)
name
- the name of the medium mappublic void createIncludePageSegment(java.lang.String name, int x, int y)
name
- the name of the include page segmentx
- the x coordinate for the overlayy
- the y coordinate for the overlaypublic void createPageTagLogicalElement(TagLogicalElementBean[] attributes)
attributes
- the array of key value pairs.public void createPageGroupTagLogicalElement(TagLogicalElementBean[] attributes)
attributes
- the array of key value pairs.public void createTagLogicalElement(java.lang.String name, java.lang.String value)
name
- The tag namevalue
- The tag valuepublic void createNoOperation(java.lang.String content)
content
- byte datapublic void startPageGroup()
endPageGroup()
method must be invoked to mark the page
group ending.public void endPageGroup() throws java.io.IOException
java.io.IOException
- thrown if an I/O exception of some sort has occurredpublic void setPortraitRotation(int pageRotation)
pageRotation
- The rotation in degrees.public void setLandscapeRotation(int pageRotation)
pageRotation
- The rotation in degrees.Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.