Device
Inheritance: java.lang.Object
public abstract class Device
Implements the interface for outputting text and graphic content to abstract device. Rendering is performed page by page.
Constructors
Constructor | Description |
---|---|
Device() | Creates a new instance. |
Methods
Method | Description |
---|---|
initialize() | Initializes the device. |
getPageCount() | Gets the number of pages. |
isReady() | Shows if device is ready for output. |
getDestinationName() | Gets destination name: output file name or device description. |
create() | Creates a copy of this device. |
dispose() | Disposes the device. |
startDocument() | Starts the whole document. |
endDocument() | Finalizes the whole document. |
startPage(float width, float height) | Starts a new page. |
endPage() | Finalizes a page. |
addHyperlink(Rectangle2D activeRect, ColoredStroke border, String targetUri) | Sets the hyperlink with a URI as its target. |
setTransform(AffineTransform matrix) | Sets the current coordinate space transformation. |
setClip(Shape path) | Sets the current clip path. |
getStroke() | Gets the current stroke. |
setStroke(ColoredStroke value) | Sets the current stroke. |
getFill() | Gets the current fill color. |
setFill(Color value) | Sets the current fill color. |
getStrokeOpacity() | Gets the current stroke opacity. |
setStrokeOpacity(float value) | Sets the current stroke opacity. |
getFillOpacity() | Gets the current fill opacity. |
setFillOpacity(float value) | Sets the current fill opacity. |
drawString(String str, float originX, float originY, List | Draws a text string. |
drawPath(Shape path) | Draws a path. |
fillPath(Shape path) | Fills a path. |
showImage(Point2D origin, Dimension2D size, byte[] imageData) | Shows a raster image. |
Device()
public Device()
Creates a new instance.
initialize()
public abstract void initialize()
Initializes the device.
getPageCount()
public abstract int getPageCount()
Gets the number of pages.
Returns: int - The number of pages.
isReady()
public abstract boolean isReady()
Shows if device is ready for output.
Returns: boolean - True if device is ready to receive output. Otherwise, False .
getDestinationName()
public abstract String getDestinationName()
Gets destination name: output file name or device description.
Returns: java.lang.String - Destination name: output file name or device description.
create()
public Device create()
Creates a copy of this device.
Returns: Device - Copy of this device.
dispose()
public void dispose()
Disposes the device.
startDocument()
public abstract void startDocument()
Starts the whole document.
endDocument()
public abstract void endDocument()
Finalizes the whole document.
startPage(float width, float height)
public abstract void startPage(float width, float height)
Starts a new page.
Parameters:
Parameter | Type | Description |
---|---|---|
width | float | The page width. |
height | float | The page height. |
endPage()
public abstract void endPage()
Finalizes a page.
addHyperlink(Rectangle2D activeRect, ColoredStroke border, String targetUri)
public abstract void addHyperlink(Rectangle2D activeRect, ColoredStroke border, String targetUri)
Sets the hyperlink with a URI as its target.
Parameters:
Parameter | Type | Description |
---|---|---|
activeRect | java.awt.geom.Rectangle2D | The active rectangle of the link. |
border | ColoredStroke | The link border. |
targetUri | java.lang.String | The target URI. |
setTransform(AffineTransform matrix)
public abstract void setTransform(AffineTransform matrix)
Sets the current coordinate space transformation.
Parameters:
Parameter | Type | Description |
---|---|---|
matrix | java.awt.geom.AffineTransform | The transformation matrix. |
setClip(Shape path)
public abstract void setClip(Shape path)
Sets the current clip path.
Parameters:
Parameter | Type | Description |
---|---|---|
path | java.awt.Shape | The clip path. |
getStroke()
public ColoredStroke getStroke()
Gets the current stroke.
Returns: ColoredStroke - The current stroke.
setStroke(ColoredStroke value)
public void setStroke(ColoredStroke value)
Sets the current stroke.
Parameters:
Parameter | Type | Description |
---|---|---|
value | ColoredStroke | The new current stroke. |
getFill()
public Color getFill()
Gets the current fill color.
Returns: java.awt.Color - The current fill color.
setFill(Color value)
public void setFill(Color value)
Sets the current fill color.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.awt.Color | The new current fill color. |
getStrokeOpacity()
public float getStrokeOpacity()
Gets the current stroke opacity.
Returns: float - The current stroke opacity.
setStrokeOpacity(float value)
public void setStrokeOpacity(float value)
Sets the current stroke opacity.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | The current stroke opacity. |
getFillOpacity()
public float getFillOpacity()
Gets the current fill opacity.
Returns: float - The current fill opacity.
setFillOpacity(float value)
public void setFillOpacity(float value)
Sets the current fill opacity.
Parameters:
Parameter | Type | Description |
---|---|---|
value | float | The current fill opacity. |
drawString(String str, float originX, float originY, List charInfos)
public abstract void drawString(String str, float originX, float originY, List<GlyphData> charInfos)
Draws a text string.
Parameters:
Parameter | Type | Description |
---|---|---|
str | java.lang.String | The string. |
originX | float | The x coordinate of the origin. |
originY | float | The x coordinate of the origin. |
charInfos | java.util.List<com.aspose.tex.rendering.GlyphData> | Glyph data required for precise typesetting of a text string. |
drawPath(Shape path)
public abstract void drawPath(Shape path)
Draws a path.
Parameters:
Parameter | Type | Description |
---|---|---|
path | java.awt.Shape | A path to draw. |
fillPath(Shape path)
public abstract void fillPath(Shape path)
Fills a path.
Parameters:
Parameter | Type | Description |
---|---|---|
path | java.awt.Shape | A path to fill. |
showImage(Point2D origin, Dimension2D size, byte[] imageData)
public abstract void showImage(Point2D origin, Dimension2D size, byte[] imageData)
Shows a raster image.
Parameters:
Parameter | Type | Description |
---|---|---|
origin | java.awt.geom.Point2D | The bottom-left corner of the shown image. |
size | java.awt.geom.Dimension2D | The size of the shown image. |
imageData | byte[] | The image data. |