XpsDocument XpsDocument XpsDocument XpsDocument Class

定义

提供用于保存 XPS 文档内容的 PackageProvides a Package that holds the content of an XPS document.

public ref class XpsDocument : System::Windows::Xps::Packaging::XpsPartBase, IDisposable
public class XpsDocument : System.Windows.Xps.Packaging.XpsPartBase, IDisposable
type XpsDocument = class
    inherit XpsPartBase
    interface IDisposable
Public Class XpsDocument
Inherits XpsPartBase
Implements IDisposable
继承
XpsDocumentXpsDocumentXpsDocumentXpsDocument
实现

注解

包含一个, 它包含一个或多FixedDocument个元素。 FixedDocumentSequence XpsDocumentAn XpsDocument contains a FixedDocumentSequence that comprises one or more FixedDocument elements.

向构造函数传递一个对的引用,用于写入、存储和读取文档的内容元素。Package XpsDocumentThe XpsDocument constructor is passed a reference to a Package for writing, storing, and reading the content elements of the document.

使用Package XPSXPS 构造函数创建Package新的空。A new empty XPSXPS Package is created by using the Package constructor.

使用Package XPSXPS 方法打开现有的Package.OpenAn existing XPSXPS Package is opened by using the Package.Open method.

通过调用Package XPSXPS FixedDocumentSequence 方法将根AddFixedDocumentSequence添加到空。A FixedDocumentSequence root is added to an empty XPSXPS Package by calling the AddFixedDocumentSequence method.

PrintTicket包含打印机信息和控件的元素还FixedDocumentSequence可以与或存储在中XpsDocument的单个FixedDocumentFixedPage元素相关联。PrintTicket elements with printer information and control can also be associated with the FixedDocumentSequence, or on individual FixedDocument and FixedPage elements that are stored in the XpsDocument.

有关的详细信息XPSXPS , 请参阅可供http://go.microsoft.com/fwlink/?LinkID=65761下载的 XML 纸张规范 (XPS)。For more information about XPSXPS see the XML Paper Specification (XPS) available for download at http://go.microsoft.com/fwlink/?LinkID=65761.

构造函数

XpsDocument(Package) XpsDocument(Package) XpsDocument(Package) XpsDocument(Package)

通过访问指定的 XML 纸张规范 (XPS) Package 和使用默认的隔行扫描、资源及压缩选项来初始化 XpsDocument 类的新实例。Initializes a new instance of the XpsDocument class with access to a specified XML Paper Specification (XPS) Package and default interleaving, resource, and compression options.

XpsDocument(Package, CompressionOption) XpsDocument(Package, CompressionOption) XpsDocument(Package, CompressionOption) XpsDocument(Package, CompressionOption)

用指定的默认隔行扫描、资源和压缩选项初始化指定 XpsDocument 中包含的 Package 类的新实例。Initializes a new instance of the XpsDocument class that is contained in a specified Package with specified default interleaving, resource, and compression options.

XpsDocument(Package, CompressionOption, String) XpsDocument(Package, CompressionOption, String) XpsDocument(Package, CompressionOption, String) XpsDocument(Package, CompressionOption, String)

用指定的默认隔行扫描、资源和压缩选项初始化指定 XpsDocument 中包含的 Package 类的新实例。Initializes a new instance of the XpsDocument class that is contained in a specified Package with the specified default interleaving, resource, and compression options.

XpsDocument(String, FileAccess) XpsDocument(String, FileAccess) XpsDocument(String, FileAccess) XpsDocument(String, FileAccess)

用默认的隔行扫描、资源和压缩选项初始化指定的 XpsDocument 文件中包含的 Package 类的新实例。Initializes a new instance of the XpsDocument class that is contained in a specified Package file with default interleaving, resource, and compression options.

XpsDocument(String, FileAccess, CompressionOption) XpsDocument(String, FileAccess, CompressionOption) XpsDocument(String, FileAccess, CompressionOption) XpsDocument(String, FileAccess, CompressionOption)

用默认的隔行扫描、资源和压缩选项初始化指定的 XpsDocument 文件中包含的 Package 类的新实例。Initializes a new instance of the XpsDocument class that is contained in a specified Package file with default interleaving, resource, and compression options.

属性

CoreDocumentProperties CoreDocumentProperties CoreDocumentProperties CoreDocumentProperties

获取 XPSXPS 文档的核心 PackagePropertiesGets the core PackageProperties of the XPSXPS document.

FixedDocumentSequenceReader FixedDocumentSequenceReader FixedDocumentSequenceReader FixedDocumentSequenceReader

获取一个用于阅读文档的 IXpsFixedDocumentSequenceReaderGets an IXpsFixedDocumentSequenceReader for reading the document.

IsReader IsReader IsReader IsReader

获取一个值,该值指示包是否可读。Gets a value that indicates whether the package is readable.

IsSignable IsSignable IsSignable IsSignable

获取一个值,该值指示是否可对包进行数字签名。Gets a value that indicates whether the package can be digitally signed.

IsWriter IsWriter IsWriter IsWriter

获取一个值,该值指示包是否可写。Gets a value that indicates whether the package is writable.

Signatures Signatures Signatures Signatures

获取与包关联的 XML 纸张规范 (XPS) 签名的集合。Gets a collection of XML Paper Specification (XPS) signatures that are associated with the package.

Thumbnail Thumbnail Thumbnail Thumbnail

获取或设置与文档关联的 XML 纸张规范 (XPS)XML Paper Specification (XPS) 缩略图像。Gets or sets the XML 纸张规范 (XPS)XML Paper Specification (XPS) thumbnail image that is associated with the document.

Uri Uri Uri Uri

获取或设置部件的 统一资源标识符 (URI)uniform resource identifier (URI)Gets or sets the 统一资源标识符 (URI)uniform resource identifier (URI) of the part.

(Inherited from XpsPartBase)

方法

AddFixedDocumentSequence() AddFixedDocumentSequence() AddFixedDocumentSequence() AddFixedDocumentSequence()

将根 FixedDocumentSequence 添加到包中并返回一个编写器。Adds a root FixedDocumentSequence to the package and returns a writer.

AddThumbnail(XpsImageType) AddThumbnail(XpsImageType) AddThumbnail(XpsImageType) AddThumbnail(XpsImageType)

向包中添加缩略图像。Adds a thumbnail image to the package.

Close() Close() Close() Close()

关闭 XPS 文档 PackageCloses the XPS document Package.

CreateXpsDocumentWriter(XpsDocument) CreateXpsDocumentWriter(XpsDocument) CreateXpsDocumentWriter(XpsDocument) CreateXpsDocumentWriter(XpsDocument)

创建一个用于编写 XpsDocumentWriterXpsDocumentCreates an XpsDocumentWriter for writing an XpsDocument.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

释放由 XpsDocument 占用的非托管资源,还可以选择释放托管资源。Releases the unmanaged resources that are used by the XpsDocument and optionally, releases the managed resources.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定指定的对象是否等于当前对象。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetFixedDocumentSequence() GetFixedDocumentSequence() GetFixedDocumentSequence() GetFixedDocumentSequence()

返回位于包根位置的固定文档序列。Returns the fixed-document sequence at the root of the package.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

作为默认哈希函数。Serves as the default hash function.

(Inherited from Object)
GetType() GetType() GetType() GetType()

获取当前实例的 TypeGets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

创建当前 Object 的浅表副本。Creates a shallow copy of the current Object.

(Inherited from Object)
RemoveSignature(XpsDigitalSignature) RemoveSignature(XpsDigitalSignature) RemoveSignature(XpsDigitalSignature) RemoveSignature(XpsDigitalSignature)

从包中删除签名。Deletes a signature from the package.

SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions)

使用指定的 X.509 证书对包部件集合进行签名。Signs a collection of package parts with a specified X.509 certificate.

SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions, Guid) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions, Guid) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions, Guid) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions, Guid)

使用指定的 X.509 证书对包部件的集合进行签名。Signs a collection of package parts by using a specified X.509 certificate.

SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions, Guid, Boolean) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions, Guid, Boolean) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions, Guid, Boolean) SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions, Guid, Boolean)

使用指定的 X.509 证书对包部件集合进行签名。Signs a collection of package parts with a specified X.509 certificate.

ToString() ToString() ToString() ToString()

返回表示当前对象的字符串。Returns a string that represents the current object.

(Inherited from Object)

显式界面实现

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

此成员支持 Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) 基础结构,但不能在代码中直接使用。This member supports the Windows Presentation Foundation (WPF)Windows Presentation Foundation (WPF) infrastructure and is not intended to be used directly from your code. 改用类型安全的 Dispose(Boolean) 方法。Use the type-safe Dispose(Boolean) method instead.

适用于

另请参阅