Class PageAPI
命名空间: Aspose.Page.XPS.Features.EventBasedModifications
程序集: Aspose.Page.dll (25.1.2)
Page 元素修改 API。
public class PageAPI : IModificationAPI
继承
实现
继承成员
object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()
属性
高度
返回/设置页面的高度,以有效坐标空间的单位表示的实数。
public float Height { get; set; }
属性值
页面计数
返回活动文档中的页面数量。
public int PageCount { get; }
属性值
总页面计数
返回 XPS 文档中所有文档的总页面数量。
public int TotalPageCount { get; }
属性值
工具
获取提供超出正式 XPS 操作 API 的实用程序的对象。
public DocumentUtils Utils { get; }
属性值
宽度
返回/设置页面的宽度,以有效坐标空间的单位表示的实数。
public float Width { get; set; }
属性值
方法
Add<t>(T)
添加一个内容元素(画布、路径或字形)。
public T Add<t>(T element) where T : XpsContentElement
参数
element
T
要添加的元素。
返回
T
添加的元素。
类型参数
T
元素的类型。
AddCanvas()
向页面添加一个新画布。
public XpsCanvas AddCanvas()
返回
添加的画布。
AddGlyphs(string, float, FontStyle, float, float, string)
向页面添加新字形。
public XpsGlyphs AddGlyphs(string fontFamily, float fontRenderingEmSize, FontStyle fontStyle, float originX, float originY, string unicodeString)
参数
fontFamily
string
字体系列。
fontRenderingEmSize
float
字体大小。
fontStyle
FontStyle
字体样式。
originX
float
字形原点 X 坐标。
originY
float
字形原点 Y 坐标。
unicodeString
string
要打印的字符串。
返回
添加的字形。
AddGlyphs(XpsFont, float, float, float, string)
向页面添加新字形。
public XpsGlyphs AddGlyphs(XpsFont font, float fontRenderingEmSize, float originX, float originY, string unicodeString)
参数
font
XpsFont
字体资源。
fontRenderingEmSize
float
字体大小。
originX
float
字形原点 X 坐标。
originY
float
字形原点 Y 坐标。
unicodeString
string
要打印的字符串。
返回
添加的字形。
AddOutlineEntry(string, int, int)
向文档添加一个大纲条目。
public void AddOutlineEntry(string description, int outlineLevel, int targetPageNumber)
参数
description
string
条目的描述。
outlineLevel
int
大纲级别。
targetPageNumber
int
目标页面编号。
AddPath(XpsPathGeometry)
向页面添加一个新路径。
public XpsPath AddPath(XpsPathGeometry data)
参数
data
XpsPathGeometry
路径的几何形状。
返回
添加的路径。
CreateArcSegment(PointF, SizeF, float, bool, XpsSweepDirection, bool)
创建一个新的椭圆弧段。
public XpsArcSegment CreateArcSegment(PointF point, SizeF size, float rotationAngle, bool isLargeArc, XpsSweepDirection sweepDirection, bool isStroked = true)
参数
point
PointF
椭圆弧的端点。
size
SizeF
椭圆弧的 x 和 y 半径,以 x,y 对表示。
rotationAngle
float
指示椭圆相对于当前坐标系统的旋转方式。
isLargeArc
bool
确定弧是否以 180 度或更大的角度绘制。
sweepDirection
XpsSweepDirection
弧绘制的方向。
isStroked
bool
指定是否绘制此路径段的描边。
返回
新的椭圆弧段。
CreateCanvas()
创建一个新的画布。
public XpsCanvas CreateCanvas()
返回
新画布。
CreateColor(Color)
创建一种新颜色。
public XpsColor CreateColor(Color color)
参数
color
Color
RGB 颜色的原生颜色实例。
返回
新颜色。
CreateGradientStop(XpsColor, float)
创建一个新的渐变停止。
public XpsGradientStop CreateGradientStop(XpsColor color, float offset)
参数
color
XpsColor
渐变停止颜色。
offset
float
渐变偏移。
返回
新的渐变停止。
Insert<t>(int, T)
在 index
位置插入一个元素(画布、路径或字形)。
public T Insert<t>(int index, T element) where T : XpsContentElement
参数
index
int
要插入的 element
的位置。
element
T
要插入的元素。
返回
T
插入的元素。
类型参数
T
元素的类型。
Remove<t>(T)
从页面中移除一个元素。
public T Remove<t>(T element) where T : XpsContentElement
参数
element
T
要移除的元素。
返回
T
移除的元素。
类型参数
T
元素的类型。