TextDevice

Inheritance: java.lang.Object, com.aspose.page.Device

All Implemented Interfaces: com.aspose.page.IMultiPageDevice

public class TextDevice extends Device implements IMultiPageDevice

构造函数

构造函数描述
TextDevice()

字段

字段描述
DEFAULT_SIZE
EMIT_ERRORS
EMIT_WARNINGS
VERSION当前设备版本。

方法

方法描述
closePage()
create()
dispose()
draw(Shape path)绘制路径。
drawArc(float x, float y, float width, float height, float startAngle, float arcAngle)绘制弧线。
drawImage(BufferedImage image, AffineTransform transform, Color bkg)绘制具有指定变换和背景的图像。
drawLine(float x1, float y1, float x2, float y2)绘制线段。
drawOval(float x, float y, float width, float height)绘制椭圆。
drawPolygon(float[] xPoints, float[] yPoints, int nPoints)绘制多边形。
drawPolygon(int[] xPoints, int[] yPoints, int nPoints)绘制多边形。
drawPolyline(float[] xPoints, float[] yPoints, int nPoints)绘制折线。
drawPolyline(int[] xPoints, int[] yPoints, int nPoints)绘制折线。
drawRect(float x, float y, float width, float height)绘制矩形。
drawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)绘制圆角矩形。
drawString(String str, float x, float y)
endDocument()
equals(Object arg0)
fill(Shape path)填充路径。
fillArc(float x, float y, float width, float height, float startAngle, float arcAngle)填充弧形。
fillOval(float x, float y, float width, float height)填充椭圆。
fillPolygon(float[] xPoints, float[] yPoints, int nPoints)填充多边形。
fillPolygon(int[] xPoints, int[] yPoints, int nPoints)填充多边形。
fillRect(float x, float y, float width, float height)填充矩形。
fillRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)绘制圆角矩形。
getBackground()获取页面的当前背景。
getCharTM()获取当前字符变换。
getClass()
getCreator()获取结果设备输出的创建者。
getCurrentPageNumber()
getFont()获取当前字体。
getOpacity()获取当前不透明度。
getOpacityMask()获取当前不透明度遮罩。
getPages()
getPaint()获取当前绘图。
getProperties()获取包括元数据在内的设备属性。
getProperty(String key)获取字符串属性的值。
getPropertyColor(String key)获取颜色属性的值。
getPropertyDouble(String key)获取双精度属性的值。
getPropertyInt(String key)获取整数属性的值。
getPropertyMargins(String key)获取边距属性的值。
getPropertyMatrix(String key)获取矩阵属性的值。
getPropertyRectangle(String key)获取矩形属性的值。
getPropertySize(String key)获取大小属性的值。
getSaveOptions()返回保存选项。
getSize()获取页面的尺寸。
getStroke()获取当前笔触。
getText()
getText(int startPage, int endPage)
getTextRenderingMode()获取当前文本渲染模式。
getTextStrokeWidth()获取当前文本笔画宽度。
getTransform()获取当前变换。
hashCode()
initClip()初始化设备的剪裁。
initPageNumbers()
isDirectRGB()
isMainDocument()
isProperty(String key)获取布尔属性的值。
notify()
notifyAll()
openPage(float width, float height)
openPage(String title)
renew()
renewForMerge(boolean mainDocument)
reset()
reset(boolean zeroPageNumbers)
rotate(double theta)旋转当前变换矩阵。
rotate(double theta, double x, double y)围绕一点旋转当前变换矩阵。
scale(double x, double y)缩放当前变换矩阵。
setBackground(Color background)指定页面的当前背景。
setCharTM(AffineTransform charTM)指定字符变换。
setClip(Shape clipPath)指定设备的剪裁。
setCreator(String creator)指定生成设备输出的创建者。
setFont(ITrFont font)指定字体。
setOpacity(float opacity)指定不透明度。
setOpacityMask(Paint opacityMask)指定不透明度蒙版。
setPaint(Paint paint)指定绘画。
setProperties(UserProperties props)指定包括元数据在内的设备属性。
setSaveOptions(SaveOptions options)指定用于管理渲染过程的选项。
setSize(Dimension size)
setStroke(Stroke stroke)指定笔画。
setTextRenderingMode(TextRenderingMode textRenderingMode)指定文本渲染模式。
setTextStrokeWidth(float textStrokeWidth)指定文本笔画宽度。
setTransform(AffineTransform transform)指定当前变换。
shear(double shx, double shy)对当前变换矩阵进行剪切。
startDocument()
toString()
transform(AffineTransform transform)变换当前变换矩阵。
translate(double x, double y)平移当前变换矩阵。
updatePageParameters(IMultiPageDevice device)
wait()
wait(long arg0)
wait(long arg0, int arg1)
writeComment(String comment)写入注释。
writeString(ITrFont font, String str)使用指定字体写出字符串。
writeWarning(String warning)

TextDevice()

public TextDevice()

DEFAULT_SIZE

public static final Dimension DEFAULT_SIZE

EMIT_ERRORS

public static final String EMIT_ERRORS

EMIT_WARNINGS

public static final String EMIT_WARNINGS

VERSION

public static String VERSION

当前设备版本。

closePage()

public void closePage()

在页面渲染后对设备进行必要的准备。

create()

public Device create()

创建此设备的副本。

Returns: Device

dispose()

public void dispose()

释放设备。

draw(Shape path)

public void draw(Shape path)

绘制路径。

Parameters:

参数类型描述
pathjava.awt.Shape要绘制的路径。

drawArc(float x, float y, float width, float height, float startAngle, float arcAngle)

public void drawArc(float x, float y, float width, float height, float startAngle, float arcAngle)

绘制弧线。

Parameters:

参数类型描述
xfloat弧中心的 X 坐标。
yfloat弧中心的 Y 坐标。
宽度float外接矩形的宽度。
高度float外接矩形的高度。
startAnglefloat弧的起始角度。
arcAnglefloat弧的角度。

drawImage(BufferedImage image, AffineTransform transform, Color bkg)

public void drawImage(BufferedImage image, AffineTransform transform, Color bkg)

绘制具有指定变换和背景的图像。

Parameters:

参数类型描述
imagejava.awt.image.BufferedImage要绘制的图像。
transformjava.awt.geom.AffineTransform变换。
bkgjava.awt.Color背景颜色。

drawLine(float x1, float y1, float x2, float y2)

public void drawLine(float x1, float y1, float x2, float y2)

绘制线段。

Parameters:

参数类型描述
x1float线段起点的 X 坐标。
y1float线段起点的 Y 坐标。
x2float线段终点的 X 坐标。
y2float线段终点的 Y 坐标。

drawOval(float x, float y, float width, float height)

public void drawOval(float x, float y, float width, float height)

绘制椭圆。

Parameters:

参数类型描述
xfloat椭圆中心的 X 坐标。
yfloat椭圆中心的 Y 坐标。
宽度float外接矩形的宽度。
高度float外接矩形的高度。

drawPolygon(float[] xPoints, float[] yPoints, int nPoints)

public void drawPolygon(float[] xPoints, float[] yPoints, int nPoints)

绘制多边形。

Parameters:

参数类型描述
xPointsfloat[]点的 X 坐标。
yPointsfloat[]点的 Y 坐标。
nPointsint点的数量。

drawPolygon(int[] xPoints, int[] yPoints, int nPoints)

public void drawPolygon(int[] xPoints, int[] yPoints, int nPoints)

绘制多边形。

Parameters:

参数类型描述
xPointsint[]点的 X 坐标。
yPointsint[]点的 Y 坐标。
nPointsint点的数量。

drawPolyline(float[] xPoints, float[] yPoints, int nPoints)

public void drawPolyline(float[] xPoints, float[] yPoints, int nPoints)

绘制折线。

Parameters:

参数类型描述
xPointsfloat[]点的 X 坐标。
yPointsfloat[]点的 Y 坐标。
nPointsint点的数量。

drawPolyline(int[] xPoints, int[] yPoints, int nPoints)

public void drawPolyline(int[] xPoints, int[] yPoints, int nPoints)

绘制折线。

Parameters:

参数类型描述
xPointsint[]点的 X 坐标。
yPointsint[]点的 Y 坐标。
nPointsint点的数量。

drawRect(float x, float y, float width, float height)

public void drawRect(float x, float y, float width, float height)

绘制矩形。

Parameters:

参数类型描述
xfloat矩形左上角的 X 坐标。
yfloat矩形左上角的 Y 坐标。
宽度float矩形的宽度。
高度float矩形的高度。

drawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)

public void drawRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)

绘制圆角矩形。

Parameters:

参数类型描述
xfloat矩形左上角的 X 坐标。
yfloat矩形左上角的 Y 坐标。
宽度float矩形的宽度。
高度float矩形的高度。
arcWidthfloat圆弧所围外接矩形的宽度。
arcHeightfloat圆弧所围外接矩形的高度。

drawString(String str, float x, float y)

public void drawString(String str, float x, float y)

在给定点绘制字符串。

Parameters:

参数类型描述
strjava.lang.String
xfloat
yfloat

endDocument()

public void endDocument()

在文档渲染后进行设备的必要准备。

equals(Object arg0)

public boolean equals(Object arg0)

Parameters:

参数类型描述
arg0java.lang.Object

Returns: boolean

fill(Shape path)

public void fill(Shape path)

填充路径。

Parameters:

参数类型描述
pathjava.awt.Shape要填充的路径。

fillArc(float x, float y, float width, float height, float startAngle, float arcAngle)

public void fillArc(float x, float y, float width, float height, float startAngle, float arcAngle)

填充弧形。

Parameters:

参数类型描述
xfloat弧中心的 X 坐标。
yfloat弧中心的 Y 坐标。
宽度float外接矩形的宽度。
高度float外接矩形的高度。
startAnglefloat弧的起始角度。
arcAnglefloat弧的角度。

fillOval(float x, float y, float width, float height)

public void fillOval(float x, float y, float width, float height)

填充椭圆。

Parameters:

参数类型描述
xfloat椭圆中心的 X 坐标。
yfloat椭圆中心的 Y 坐标。
宽度float外接矩形的宽度。
高度float外接矩形的高度。

fillPolygon(float[] xPoints, float[] yPoints, int nPoints)

public void fillPolygon(float[] xPoints, float[] yPoints, int nPoints)

填充多边形。

Parameters:

参数类型描述
xPointsfloat[]点的 X 坐标。
yPointsfloat[]点的 Y 坐标。
nPointsint点的数量。

fillPolygon(int[] xPoints, int[] yPoints, int nPoints)

public void fillPolygon(int[] xPoints, int[] yPoints, int nPoints)

填充多边形。

Parameters:

参数类型描述
xPointsint[]点的 X 坐标。
yPointsint[]点的 Y 坐标。
nPointsint点的数量。

fillRect(float x, float y, float width, float height)

public void fillRect(float x, float y, float width, float height)

填充矩形。

Parameters:

参数类型描述
xfloat矩形左上角的 X 坐标。
yfloat矩形左上角的 Y 坐标。
宽度float矩形的宽度。
高度float矩形的高度。

fillRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)

public void fillRoundRect(float x, float y, float width, float height, float arcWidth, float arcHeight)

绘制圆角矩形。

Parameters:

参数类型描述
xfloat矩形左上角的 X 坐标。
yfloat矩形左上角的 Y 坐标。
宽度float矩形的宽度。
高度float矩形的高度。
arcWidthfloat圆弧所围外接矩形的宽度。
arcHeightfloat圆弧所围外接矩形的高度。

getBackground()

public Color getBackground()

获取页面的当前背景。

Returns: java.awt.Color - 页面当前的背景颜色

getCharTM()

public AffineTransform getCharTM()

获取当前字符变换。

Returns: java.awt.geom.AffineTransform - 当前字符的变换。

getClass()

public final native Class<?> getClass()

Returns: java.lang.Class

getCreator()

public String getCreator()

获取结果设备输出的创建者。

Returns: java.lang.String - 创建者值。

getCurrentPageNumber()

public int getCurrentPageNumber()

获取当前页码。

Returns: int

getFont()

public ITrFont getFont()

获取当前字体。

Returns: ITrFont - Current font.

getOpacity()

public float getOpacity()

获取当前不透明度。

Returns: float - 当前不透明度。

getOpacityMask()

public Paint getOpacityMask()

获取当前不透明度遮罩。

Returns: java.awt.Paint - 当前不透明度遮罩。

getPages()

public List<String> getPages()

Returns: java.util.List<java.lang.String>

getPaint()

public Paint getPaint()

获取当前绘图。

Returns: java.awt.Paint - 当前绘图。

getProperties()

public UserProperties getProperties()

获取包括元数据在内的设备属性。

Returns: UserProperties - Device properties.

getProperty(String key)

public String getProperty(String key)

获取字符串属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: java.lang.String - 属性值。

getPropertyColor(String key)

public Color getPropertyColor(String key)

获取颜色属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: java.awt.Color - 属性值。

getPropertyDouble(String key)

public double getPropertyDouble(String key)

获取双精度属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: double - 属性值。

getPropertyInt(String key)

public int getPropertyInt(String key)

获取整数属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: int - 属性值。

getPropertyMargins(String key)

public Insets getPropertyMargins(String key)

获取边距属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: java.awt.Insets - 属性值。

getPropertyMatrix(String key)

public AffineTransform getPropertyMatrix(String key)

获取矩阵属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: java.awt.geom.AffineTransform - 属性值。

getPropertyRectangle(String key)

public Rectangle getPropertyRectangle(String key)

获取矩形属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: java.awt.Rectangle - 属性值。

getPropertySize(String key)

public Dimension getPropertySize(String key)

获取大小属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: java.awt.Dimension - 属性值。

getSaveOptions()

public SaveOptions getSaveOptions()

返回保存选项。

Returns: SaveOptions - The save options.

getSize()

public Dimension getSize()

获取页面的尺寸。

Returns: java.awt.Dimension - 页面大小。

getStroke()

public Stroke getStroke()

获取当前笔触。

Returns: java.awt.Stroke - 当前描边。

getText()

public String getText()

Returns: java.lang.String

getText(int startPage, int endPage)

public String getText(int startPage, int endPage)

Parameters:

参数类型描述
startPageint
endPageint

Returns: java.lang.String

getTextRenderingMode()

public TextRenderingMode getTextRenderingMode()

获取当前文本渲染模式。

Returns: TextRenderingMode - Current text rendering mode.

getTextStrokeWidth()

public float getTextStrokeWidth()

获取当前文本笔画宽度。

Returns: float - 当前文本笔画宽度。

getTransform()

public AffineTransform getTransform()

获取当前变换。

Returns: java.awt.geom.AffineTransform - 当前变换。

hashCode()

public native int hashCode()

Returns: int

initClip()

public void initClip()

初始化设备的剪裁。

initPageNumbers()

public void initPageNumbers()

初始化要渲染的页数。

isDirectRGB()

public boolean isDirectRGB()

指示设备是否使用直接 RGB 模式,即 RGB。

Returns: boolean

isMainDocument()

public boolean isMainDocument()

Returns: boolean

isProperty(String key)

public boolean isProperty(String key)

获取布尔属性的值。

Parameters:

参数类型描述
java.lang.String属性的名称。

Returns: boolean - 属性值。

notify()

public final native void notify()

notifyAll()

public final native void notifyAll()

openPage(float width, float height)

public boolean openPage(float width, float height)

在页面渲染之前对设备进行必要的准备。

Parameters:

参数类型描述
宽度float
高度float

Returns: boolean

openPage(String title)

public boolean openPage(String title)

在页面渲染之前对设备进行必要的准备。

Parameters:

参数类型描述
标题java.lang.String

Returns: boolean

renew()

public void renew()

将设备重置为整个文档的初始状态。用于重置输出流。

renewForMerge(boolean mainDocument)

public void renewForMerge(boolean mainDocument)

Parameters:

参数类型描述
主文档boolean

reset()

public void reset()

将设备重置为页面的初始状态。

reset(boolean zeroPageNumbers)

public void reset(boolean zeroPageNumbers)

Parameters:

参数类型描述
零页码boolean

rotate(double theta)

public void rotate(double theta)

旋转当前变换矩阵。调用 writeTransform(Transform)。使用正角度 theta 旋转会将点从正 x 轴方向旋转到正 y 轴方向。

Parameters:

参数类型描述
thetadouble要旋转的弧度角度。

rotate(double theta, double x, double y)

public void rotate(double theta, double x, double y)

围绕一点旋转当前变换矩阵。

Parameters:

参数类型描述
thetadouble弧度制的旋转角度。
xdouble点的 X 坐标。
ydouble点的 Y 坐标。

scale(double x, double y)

public void scale(double x, double y)

缩放当前的变换矩阵。调用 writeTransform(Transform)。

Parameters:

参数类型描述
xdoubleX 轴的缩放。
ydoubleY 轴的缩放。

setBackground(Color background)

public void setBackground(Color background)

指定页面的当前背景。

Parameters:

参数类型描述
背景java.awt.Color页面的背景。

setCharTM(AffineTransform charTM)

public void setCharTM(AffineTransform charTM)

指定字符变换。

Parameters:

参数类型描述
charTMjava.awt.geom.AffineTransform\u0421字符变换。

setClip(Shape clipPath)

public void setClip(Shape clipPath)

指定设备的剪裁。

Parameters:

参数类型描述
clipPathjava.awt.Shape裁剪路径。

setCreator(String creator)

public void setCreator(String creator)

指定生成设备输出的创建者。

Parameters:

参数类型描述
creatorjava.lang.String创建者值。

setFont(ITrFont font)

public void setFont(ITrFont font)

指定字体。

Parameters:

参数类型描述
fontITrFont字体。

setOpacity(float opacity)

public void setOpacity(float opacity)

指定不透明度。

Parameters:

参数类型描述
opacityfloat不透明度。

setOpacityMask(Paint opacityMask)

public void setOpacityMask(Paint opacityMask)

指定不透明度蒙版。

Parameters:

参数类型描述
opacityMaskjava.awt.Paint一个不透明度蒙版。

setPaint(Paint paint)

public void setPaint(Paint paint)

指定绘画。

Parameters:

参数类型描述
paintjava.awt.Paint一种绘画。

setProperties(UserProperties props)

public void setProperties(UserProperties props)

指定包括元数据在内的设备属性。

Parameters:

参数类型描述
propsUserProperties设备属性。

setSaveOptions(SaveOptions options)

public void setSaveOptions(SaveOptions options)

指定用于管理渲染过程的选项。

Parameters:

参数类型描述
optionsSaveOptions用于管理渲染过程的选项。

setSize(Dimension size)

public void setSize(Dimension size)

指定页面大小。

Parameters:

参数类型描述
大小java.awt.Dimension

setStroke(Stroke stroke)

public void setStroke(Stroke stroke)

指定笔画。

Parameters:

参数类型描述
strokejava.awt.Stroke一个描边。

setTextRenderingMode(TextRenderingMode textRenderingMode)

public void setTextRenderingMode(TextRenderingMode textRenderingMode)

指定文本渲染模式。

Parameters:

参数类型描述
textRenderingModeTextRenderingMode文本渲染模式。

setTextStrokeWidth(float textStrokeWidth)

public void setTextStrokeWidth(float textStrokeWidth)

指定文本笔画宽度。

Parameters:

参数类型描述
textStrokeWidthfloat文本描边宽度。

setTransform(AffineTransform transform)

public void setTransform(AffineTransform transform)

指定当前变换。

Parameters:

参数类型描述
transformjava.awt.geom.AffineTransform一个变换..

shear(double shx, double shy)

public void shear(double shx, double shy)

剪切当前的变换矩阵。调用 writeTransform(Transform)。

Parameters:

参数类型描述
shxdoubleX 轴的剪切。
shydoubleY 轴的剪切。

startDocument()

public void startDocument()

在开始渲染文档之前,对设备进行必要的准备。

toString()

public String toString()

返回设备类型的名称。

Returns: java.lang.String

transform(AffineTransform transform)

public void transform(AffineTransform transform)

变换当前的变换矩阵。调用 writeTransform(Transform)。

Parameters:

参数类型描述
transformjava.awt.geom.AffineTransform要应用的变换。

translate(double x, double y)

public void translate(double x, double y)

平移当前的变换矩阵。调用 writeTransform(Transform)。

Parameters:

参数类型描述
xdoubleX 轴的平移。
ydoubleY 轴的平移。

updatePageParameters(IMultiPageDevice device)

public void updatePageParameters(IMultiPageDevice device)

从其他多页设备更新页面参数。

Parameters:

参数类型描述
deviceIMultiPageDevice

wait()

public final void wait()

wait(long arg0)

public final native void wait(long arg0)

Parameters:

参数类型描述
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

参数类型描述
arg0long
arg1int

writeComment(String comment)

public void writeComment(String comment)

写入注释。

Parameters:

参数类型描述
注释java.lang.String要写入的注释。

writeString(ITrFont font, String str)

public void writeString(ITrFont font, String str)

使用指定字体写出字符串。

Parameters:

参数类型描述
fontITrFont指定的字体。
strjava.lang.String该字符串。

writeWarning(String warning)

public void writeWarning(String warning)

Parameters:

参数类型描述
警告java.lang.String