Class XpsDocument

XpsDocument class

类封装 XPS 文档的主要实体,为任何 XPS 元素提供操作 方法。

public sealed class XpsDocument : Document, IDisposable

构造函数

姓名描述
XpsDocument()创建具有默认页面大小的空 XPS 文档。
XpsDocument(string)打开位于path.
XpsDocument(Stream, LoadOptions)加载存储在stream作为 XPS 文档.
XpsDocument(string, LoadOptions)打开位于path作为 XPS 文档.

特性

姓名描述
ActiveDocument { get; }获取活动文档编号。
ActivePage { get; }获取活动文档中的活动页码。
DocumentCount { get; }返回 XPS 包内的文档数。
JobPrintTicket { get; set; }返回/设置文档的作业打印票证
Page { get; }返回一个XpsPage活动页面的实例.
PageCount { get; }返回活动文档中的页数。
TotalPageCount { get; }返回 XPS 文档中所有文档的总页数。

方法

姓名描述
Add<T>(T)添加内容元素(画布、路径或字形)
AddCanvas()将新画布添加到活动页面。
AddDocument(bool)添加具有默认页面大小的空文档。
AddDocument(float, float, bool)添加第一页尺寸为 的空文档widthheight.
AddGlyphs(XpsFont, float, float, float, string)将新字形添加到活动页面。
AddGlyphs(string, float, FontStyle, float, float, string)将新字形添加到活动页面。
AddOutlineEntry(string, int, XpsHyperlinkTarget)向文档添加大纲条目。
AddPage(bool)使用默认页面大小向文档添加一个空页面。
AddPage(XpsPage, bool)向文档添加一页。
AddPage(float, float, bool)添加一个空页到指定的 文档widthheight.
AddPath(XpsPathGeometry)添加到活动页面的新路径。
CreateArcSegment(PointF, SizeF, float, bool, XpsSweepDirection, bool)创建一个新的椭圆弧段。
CreateCanvas()创建一个新画布。
CreateColor(Color)创建新颜色。
CreateColor(string, params float[])在基于 ICC 的色彩空间中创建新颜色。
CreateColor(XpsIccProfile, params float[])在基于 ICC 的色彩空间中创建新颜色。
CreateColor(float, float, float)在 scRGB 颜色空间中创建新颜色。
CreateColor(int, int, int)在 sRGB 颜色空间中创建新颜色。
CreateColor(float, float, float, float)在 scRGB 颜色空间中创建新颜色。
CreateColor(int, int, int, int)在 sRGB 颜色空间中创建新颜色。
CreateFont(Stream)从流中创建新的 TrueType 字体资源。
CreateFont(string, FontStyle)创建新的 TrueType 字体资源。
CreateGlyphs(XpsFont, float, float, float, string)创建新字形。
CreateGlyphs(string, float, FontStyle, float, float, string)创建新字形。
CreateGradientStop(Color, float)创建一个新的渐变色标。
CreateGradientStop(XpsColor, float)创建一个新的渐变色标。
CreateIccProfile(Stream)创建一个新的 ICC 配置文件资源stream.
CreateIccProfile(string)从位于 the 的 ICC 配置文件创建新的 ICC 配置文件资源iccProfilePath.
CreateImage(Stream)创建一个新的图像资源stream.
CreateImage(string)从位于的图像文件中创建一个新的图像资源imagePath.
CreateImageBrush(string, RectangleF, RectangleF)创建一个新的图像画笔。
CreateImageBrush(XpsImage, RectangleF, RectangleF)创建一个新的图像画笔。
CreateLinearGradientBrush(PointF, PointF)创建一个新的线性渐变画笔。
CreateLinearGradientBrush(List<XpsGradientStop>, PointF, PointF)创建一个新的线性渐变画笔。
CreateMatrix(float, float, float, float, float, float)创建一个新的仿射变换矩阵。
CreatePath(XpsPathGeometry)创建新路径。
CreatePathFigure(PointF, bool)创建一个新路径图。
CreatePathFigure(PointF, List<XpsPathSegment>, bool)创建一个新路径图。
CreatePathGeometry()创建一个新的路径几何。
CreatePathGeometry(List<XpsPathFigure>)创建具有指定路径图形列表的新路径几何。
CreatePathGeometry(string)创建以缩写形式指定的新路径几何。
CreatePolyBezierSegment(PointF[], bool)创建一组新的三次贝塞尔曲线。
CreatePolyLineSegment(PointF[], bool)创建包含任意数量的单个顶点的新多边形图形。
CreatePolyQuadraticBezierSegment(PointF[], bool)创建一组新的二次贝塞尔曲线,从路径图形中的前一个点到 set 个顶点,使用指定的控制点。
CreateRadialGradientBrush(PointF, PointF, float, float)创建一个新的径向渐变画笔。
CreateRadialGradientBrush(List<XpsGradientStop>, PointF, PointF, float, float)创建一个新的径向渐变画笔。
CreateSolidColorBrush(Color)创建一个新的纯色画笔。
CreateSolidColorBrush(XpsColor)创建一个新的纯色画笔。
CreateVisualBrush(XpsContentElement, RectangleF, RectangleF)创建一个新的视觉画笔。
Dispose()处理实例。
GetDocumentPrintTicket(int)返回由索引的文档的打印票documentIndex.
GetPagePrintTicket(int, int)返回由索引的页面的打印票pageIndex 在被索引的文档中documentIndex.
Insert<T>(int, T)将元素(画布、路径或字形)插入到活动页面 处index位置.
InsertCanvas(int)将新画布插入活动页面index位置.
InsertDocument(int, bool)插入默认页面大小为 的空文档index位置.
InsertDocument(int, float, float, bool)插入第一页尺寸为 的空文档widthheightindex位置.
InsertGlyphs(int, XpsFont, float, float, float, string)将新字形插入活动页面index位置.
InsertGlyphs(int, string, float, FontStyle, float, float, string)将新字形插入活动页面index位置.
InsertPage(int, bool)以默认页面大小 在文档中插入一个空页面index位置.
InsertPage(int, XpsPage, bool)在文档中插入一页index位置.
InsertPage(int, float, float, bool)将空白页插入到指定 的文档中widthheightindex位置.
InsertPath(int, XpsPathGeometry)插入到活动页面的新路径index位置.
Merge(string[], Stream)将多个 XPS 文件合并为一个 XPS 文档。
Merge(string[], Device, SaveOptions)使用将 XPS 文档合并为 PDFDevice实例.
Remove<T>(T)从活动页面中删除一个元素。
RemoveAt(int)删除元素index活动页面的位置.
RemoveDocumentAt(int)删除文档index位置.
RemovePage(XpsPage)从文档中删除一页。
RemovePageAt(int)从文档中删除一页index位置.
Save(Stream)将 XPS 文档保存到流中。
Save(string)将 XPS 文档保存到位于path.
override Save(Device, SaveOptions)使用Device实例.
SelectActiveDocument(int)选择一个活动文档进行编辑。
SelectActivePage(int)选择活动文档页面进行编辑。
SetDocumentPrintTicket(int, DocumentPrintTicket)链接printTicket到索引的文档documentIndex.
SetPagePrintTicket(int, int, PagePrintTicket)链接printTicket到索引的页面pageIndex 在被索引的文档中documentIndex.

也可以看看