XpsDocument 類別

定義

提供存放 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
繼承
XpsDocument
實作

備註

XpsDocument 包含由一個或多個 FixedDocument 元素組成的 FixedDocumentSequenceAn 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.

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

您可以使用 Package.Open 方法來開啟現有的 XPSXPS PackageAn existing XPSXPS Package is opened by using the Package.Open method.

FixedDocumentSequence 根會藉由呼叫 AddFixedDocumentSequence 方法加入至空的 XPSXPS PackageA 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 的詳細資訊,請參閱可在https://go.microsoft.com/fwlink/?LinkID=65761下載的 XML 檔規格(XPS)。For more information about XPSXPS see the XML Paper Specification (XPS) available for download at https://go.microsoft.com/fwlink/?LinkID=65761.

建構函式

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 類別的新執行個體,此類別包含於指定的 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 類別的新執行個體,此類別包含於指定的 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 類別的新執行個體,此類別包含於指定的 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 類別的新執行個體,此類別包含於指定的 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

取得 XPSXPS 文件的核心 PackagePropertiesGets the core PackageProperties of the XPSXPS document.

FixedDocumentSequenceReader

取得用於讀取文件的 IXpsFixedDocumentSequenceReaderGets an IXpsFixedDocumentSequenceReader for reading the document.

IsReader

取得值,指出封裝是否為可讀取。Gets a value that indicates whether the package is readable.

IsSignable

取得值,指示封裝是否可以數位方式簽署。Gets a value that indicates whether the package can be digitally signed.

IsWriter

取得值,指出封裝是否為可寫入。Gets a value that indicates whether the package is writable.

Signatures

取得 XML 文件規格 (XPS) 簽章的集合,這些簽章與套件建立關聯。Gets a collection of XML Paper Specification (XPS) signatures that are associated with the package.

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)。Gets or sets the uniform resource identifier (URI) of the part.

(繼承來源 XpsPartBase)

方法

AddFixedDocumentSequence()

將根 FixedDocumentSequence 加入至封裝,並傳回寫入器。Adds a root FixedDocumentSequence to the package and returns a writer.

AddThumbnail(XpsImageType)

將縮圖影像加入至封裝。Adds a thumbnail image to the package.

Close()

關閉 XPS 文件 PackageCloses the XPS document Package.

CreateXpsDocumentWriter(XpsDocument)

建立用於寫入 XpsDocumentWriterXpsDocumentCreates an XpsDocumentWriter for writing an XpsDocument.

Dispose(Boolean)

釋放 XpsDocument 所使用的 Unmanaged 資源,並選擇性地釋放 Managed 資源。Releases the unmanaged resources that are used by the XpsDocument and optionally, releases the managed resources.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetFixedDocumentSequence()

在封裝的根傳回固定格式文件序列。Returns the fixed-document sequence at the root of the package.

GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
RemoveSignature(XpsDigitalSignature)

刪除封裝中的簽章。Deletes a signature from the package.

SignDigitally(X509Certificate, Boolean, XpsDigSigPartAlteringRestrictions)

以指定的 X.509 憑證簽署封裝組件的集合。Signs a collection of package parts with a specified X.509 certificate.

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)

以指定的 X.509 憑證簽署封裝組件的集合。Signs a collection of package parts with a specified X.509 certificate.

ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)

明確介面實作

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.

適用於

另請參閱