public abstract class Device<TGraphicContext extends GraphicContext,TRenderingOptions extends RenderingOptions> extends Object implements IDevice
Represents base class for implementation particular rendering devices.
TGraphicContext
: Graphic context that holds current graphics control parameters
TRenderingOptions
: Rendering options
Modifier and Type | Class and Description |
---|---|
static class |
Device.DeviceConfiguration
Represents configuration object for devices.
|
static class |
Device.PageWritingStrategy
Specifies types of strategies for writing pages into output stream\streams.
|
Constructor and Description |
---|
Device(TRenderingOptions options,
InputStream stream)
Initializes a new instance of the
Device{TGraphicContext,TRenderingOptions} class by rendering options and output stream. |
Device(TRenderingOptions options,
OutputStream outputStream)
Initializes a new instance of the
Device{TGraphicContext,TRenderingOptions} class by rendering options and output stream. |
Modifier and Type | Method and Description |
---|---|
abstract void |
addRect(com.aspose.html.internal.ms.System.Drawing.RectangleF rect)
Appends a rectangle to the current path as a complete subpath.
|
void |
beginDocument(Document document)
Begins rendering of the document.
|
abstract boolean |
beginElement(Element element,
com.aspose.html.internal.ms.System.Drawing.RectangleF rect)
Begins rendering of the html node.
|
void |
beginPage(com.aspose.html.internal.ms.System.Drawing.SizeF size)
Begins rendering of the new page.
|
abstract void |
clip(int mode)
Modifies the current clipping path by intersecting it with the current path, using the FillMode rule to determine the region to fill.
|
abstract void |
closePath()
Closes the current subpath by appending a straight line segment from the current point to the starting point of the subpath.
|
abstract void |
cubicBezierTo(com.aspose.html.internal.ms.System.Drawing.PointF pt1,
com.aspose.html.internal.ms.System.Drawing.PointF pt2,
com.aspose.html.internal.ms.System.Drawing.PointF pt3)
Appends a cubic Bézier curve to the current path.
|
void |
dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
|
abstract void |
drawImage(byte[] data,
int type,
com.aspose.html.internal.ms.System.Drawing.RectangleF rect)
Draws the specified image.
|
void |
endDocument()
Ends rendering of the document.
|
abstract void |
endElement(Element element)
Ends rendering of the html node.
|
void |
endPage()
Ends rendering of the current page.
|
abstract void |
fill(int mode)
Fills the entire region enclosed by the current path.
|
abstract void |
fillText(String text,
com.aspose.html.internal.ms.System.Drawing.PointF pt)
Fills the specified text string at the specified location.
|
void |
flush()
Flushes all data to output stream.
|
Document |
getCurrentDocument() |
TGraphicContext |
getGraphicContext()
Gets the graphic context
|
TRenderingOptions |
getOptions()
Gets rendering options.
|
com.aspose.html.internal.ms.System.IO.Stream |
getOriginalOutputStream() |
int |
getPageIndex()
Sets or gets the index of the current page
|
boolean |
getRenderingStarted() |
void |
initPageBackground(com.aspose.html.internal.ms.System.Drawing.SizeF size) |
abstract void |
lineTo(com.aspose.html.internal.ms.System.Drawing.PointF pt)
Appends a straight line segment from the current point to the point (pt).
|
abstract void |
moveTo(com.aspose.html.internal.ms.System.Drawing.PointF pt)
Begins a new subpath by moving the current point to coordinates of the parameter pt, omitting any connecting line segment.
|
void |
restoreGraphicContext()
Restores the entire graphics context to its former value by popping it from the stack.
|
void |
saveGraphicContext()
Pushes a copy of the entire graphics context onto the stack.
|
void |
setCurrentDocument(Document value) |
void |
setPageIndex(int value)
Sets or gets the index of the current page
|
abstract void |
stroke()
Strokes a line along the current path.
|
abstract void |
strokeAndFill(int mode)
Strokes and fill current path.
|
abstract void |
strokeText(String text,
com.aspose.html.internal.ms.System.Drawing.PointF pt)
Strokes the specified text string at the specified location.
|
public Device(TRenderingOptions options, InputStream stream)
Initializes a new instance of the Device{TGraphicContext,TRenderingOptions}
class by rendering options and output stream.
options
- Rendering options.stream
- The output stream.public Device(TRenderingOptions options, OutputStream outputStream)
Initializes a new instance of the Device{TGraphicContext,TRenderingOptions}
class by rendering options and output stream.
options
- Rendering options.outputStream
- The java.io.OutputStream.public TRenderingOptions getOptions()
Gets rendering options.
getOptions
in interface IDevice
public TGraphicContext getGraphicContext()
Gets the graphic context
getGraphicContext
in interface IDevice
public com.aspose.html.internal.ms.System.IO.Stream getOriginalOutputStream()
public void saveGraphicContext()
Pushes a copy of the entire graphics context onto the stack.
saveGraphicContext
in interface IDevice
public void restoreGraphicContext()
Restores the entire graphics context to its former value by popping it from the stack.
restoreGraphicContext
in interface IDevice
public int getPageIndex()
Sets or gets the index of the current page
public void setPageIndex(int value)
Sets or gets the index of the current page
public Document getCurrentDocument()
public void setCurrentDocument(Document value)
public boolean getRenderingStarted()
public void beginDocument(Document document)
Begins rendering of the document.
beginDocument
in interface IDevice
document
- The document.public void endDocument()
Ends rendering of the document.
endDocument
in interface IDevice
public void beginPage(com.aspose.html.internal.ms.System.Drawing.SizeF size)
Begins rendering of the new page.
public void endPage()
Ends rendering of the current page.
public void flush()
Flushes all data to output stream.
public abstract boolean beginElement(Element element, com.aspose.html.internal.ms.System.Drawing.RectangleF rect)
Begins rendering of the html node.
beginElement
in interface IDevice
element
- The html element.rect
- Bounding box of the node.public abstract void endElement(Element element)
Ends rendering of the html node.
endElement
in interface IDevice
element
- The html element.public abstract void closePath()
Closes the current subpath by appending a straight line segment from the current point to the starting point of the subpath. If the current subpath is already closed, "ClosePath" does nothing. This operator terminates the current subpath. Appending another segment to the current path begins a new subpath, even if the new segment begins at the endpoint reached by the "ClosePath" method.
public abstract void moveTo(com.aspose.html.internal.ms.System.Drawing.PointF pt)
Begins a new subpath by moving the current point to coordinates of the parameter pt, omitting any connecting line segment. If the previous path construction method in the current path was also "MoveTo", the new "MoveTo" overrides it; no vestige of the previous "MoveTo" operation remains in the path.
public abstract void lineTo(com.aspose.html.internal.ms.System.Drawing.PointF pt)
Appends a straight line segment from the current point to the point (pt). The new current point is pt.
public abstract void addRect(com.aspose.html.internal.ms.System.Drawing.RectangleF rect)
Appends a rectangle to the current path as a complete subpath.
public abstract void cubicBezierTo(com.aspose.html.internal.ms.System.Drawing.PointF pt1, com.aspose.html.internal.ms.System.Drawing.PointF pt2, com.aspose.html.internal.ms.System.Drawing.PointF pt3)
Appends a cubic Bézier curve to the current path. The curve extends from the current point to the point pt2, using pt1 and pt2 as the Bézier control points. The new current point is pt3.
cubicBezierTo
in interface IDevice
pt1
- Coordinates of first pointpt2
- Coordinates of second pointpt3
- Coordinates of third pointpublic abstract void stroke()
Strokes a line along the current path. The stroked line follows each straight or curved segment in the path, centered on the segment with sides parallel to it. Each of the path’s subpaths is treated separately. This method terminates current path.
public abstract void fill(int mode)
Fills the entire region enclosed by the current path. If the path consists of several disconnected subpaths, it fills the insides of all subpaths, considered together. This method terminates current path.
public abstract void clip(int mode)
Modifies the current clipping path by intersecting it with the current path, using the FillMode rule to determine the region to fill. This method terminates current path.
public abstract void strokeAndFill(int mode)
Strokes and fill current path. This method terminates current path.
strokeAndFill
in interface IDevice
mode
- Filling mode specifies how the interior of a closed path is filled.public abstract void fillText(String text, com.aspose.html.internal.ms.System.Drawing.PointF pt)
Fills the specified text string at the specified location.
public abstract void strokeText(String text, com.aspose.html.internal.ms.System.Drawing.PointF pt)
Strokes the specified text string at the specified location.
strokeText
in interface IDevice
text
- String to stroke.pt
- Point that specifies the coordinates where to start the text.public abstract void drawImage(byte[] data, int type, com.aspose.html.internal.ms.System.Drawing.RectangleF rect)
Draws the specified image.
public void dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
dispose
in interface com.aspose.html.internal.ms.System.IDisposable
public void initPageBackground(com.aspose.html.internal.ms.System.Drawing.SizeF size)