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.

XpsDocument將的參考Package傳遞給此函式, 以寫入、儲存和讀取檔的內容元素。The XpsDocument constructor is passed a reference to a Package for writing, storing, and reading the content elements of the document.

新的空白XPSXPS Package是使用此Package函式建立的。A new empty XPSXPS Package is created by using the Package constructor.

會使用XPSXPS方法來開啟現有Package的。 Package.OpenAn existing XPSXPS Package is opened by using the Package.Open method.

藉由呼叫XPSXPS Package 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 類別的新執行個體,此類別包含於指定的 PackageInitializes 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 類別的新執行個體,此類別包含於指定的 PackageInitializes 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 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。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 的淺層複本 (Shallow Copy)。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.

適用於

另請參閱