XpsDocument Construtores

Definição

Inicializa uma nova instância da classe XpsDocument.Initializes a new instance of the XpsDocument class.

Sobrecargas

XpsDocument(Package)

Inicializa uma nova instância da classe XpsDocument com acesso a um XPS (XML Paper Specification) especificado Package e opções padrão de compactação, recurso e intercalação.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)

Inicializa uma nova instância da classe XpsDocument contida em um Package especificado com as opções de compactação, recurso e intercalação padrão especificadas.Initializes a new instance of the XpsDocument class that is contained in a specified Package with specified default interleaving, resource, and compression options.

XpsDocument(String, FileAccess)

Inicializa uma nova instância da classe XpsDocument contida em um arquivo Package especificado com as opções de compactação, recurso e intercalação padrão.Initializes a new instance of the XpsDocument class that is contained in a specified Package file with default interleaving, resource, and compression options.

XpsDocument(Package, CompressionOption, String)

Inicializa uma nova instância da classe XpsDocument contida em um Package especificado com as opções de compactação, recurso e intercalação padrão especificadas.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, CompressionOption)

Inicializa uma nova instância da classe XpsDocument contida em um arquivo Package especificado com as opções de compactação, recurso e intercalação padrão.Initializes a new instance of the XpsDocument class that is contained in a specified Package file with default interleaving, resource, and compression options.

Exemplos

O exemplo a seguir mostra como criar e fechar um XpsDocument.The following example shows how to create and close an XpsDocument.

// Create an XpsDocument package (without PrintTicket).
{
   Package^ package = Package::Open(packageName);
   try
   {
      XpsDocument^ xpsDocument = gcnew XpsDocument(package);

      // Add the package content (false=without PrintTicket).
      AddPackageContent(xpsDocument, false);

      // Close the package.
      xpsDocument->Close();
   } finally
   {
      delete package;
   }
// Create an XpsDocument package (without PrintTicket).
using (Package package = Package.Open(packageName))
{
    XpsDocument xpsDocument = new XpsDocument(package);

    // Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, false);

    // Close the package.
    xpsDocument.Close();
}
' Create an XpsDocument package (without PrintTicket).
Using package1 As Package = Package.Open(packageName)
    Dim xpsDocument As New XpsDocument(package1)

    ' Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, False)

    ' Close the package.
    xpsDocument.Close()
End Using

O exemplo a seguir também mostra como criar e fechar um XpsDocument.The following example also shows how to create and close an XpsDocument.

// Save as a WordXML document.
WordXmlSerializer.SaveToFile(fileName, flowDocument.ContentStart, flowDocument.ContentEnd);
return true;

XpsDocument(Package)

Inicializa uma nova instância da classe XpsDocument com acesso a um XPS (XML Paper Specification) especificado Package e opções padrão de compactação, recurso e intercalação.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.

public:
 XpsDocument(System::IO::Packaging::Package ^ package);
public XpsDocument (System.IO.Packaging.Package package);
new System.Windows.Xps.Packaging.XpsDocument : System.IO.Packaging.Package -> System.Windows.Xps.Packaging.XpsDocument

Parâmetros

package
Package

O pacote XPS de destino para XpsDocument.The target XPS package for the XpsDocument.

Exemplos

O exemplo a seguir mostra como criar e fechar um XpsDocument.The following example shows how to create and close an XpsDocument.

// Create an XpsDocument package (without PrintTicket).
{
   Package^ package = Package::Open(packageName);
   try
   {
      XpsDocument^ xpsDocument = gcnew XpsDocument(package);

      // Add the package content (false=without PrintTicket).
      AddPackageContent(xpsDocument, false);

      // Close the package.
      xpsDocument->Close();
   } finally
   {
      delete package;
   }
// Create an XpsDocument package (without PrintTicket).
using (Package package = Package.Open(packageName))
{
    XpsDocument xpsDocument = new XpsDocument(package);

    // Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, false);

    // Close the package.
    xpsDocument.Close();
}
' Create an XpsDocument package (without PrintTicket).
Using package1 As Package = Package.Open(packageName)
    Dim xpsDocument As New XpsDocument(package1)

    ' Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, False)

    ' Close the package.
    xpsDocument.Close()
End Using

O exemplo a seguir também mostra como criar e fechar um XpsDocument.The following example also shows how to create and close an XpsDocument.

// Save as a WordXML document.
WordXmlSerializer.SaveToFile(fileName, flowDocument.ContentStart, flowDocument.ContentEnd);
return true;

XpsDocument(Package, CompressionOption)

Inicializa uma nova instância da classe XpsDocument contida em um Package especificado com as opções de compactação, recurso e intercalação padrão especificadas.Initializes a new instance of the XpsDocument class that is contained in a specified Package with specified default interleaving, resource, and compression options.

public:
 XpsDocument(System::IO::Packaging::Package ^ package, System::IO::Packaging::CompressionOption compressionOption);
public XpsDocument (System.IO.Packaging.Package package, System.IO.Packaging.CompressionOption compressionOption);
new System.Windows.Xps.Packaging.XpsDocument : System.IO.Packaging.Package * System.IO.Packaging.CompressionOption -> System.Windows.Xps.Packaging.XpsDocument

Parâmetros

package
Package

O pacote de destino para XpsDocument.The target package for the XpsDocument.

compressionOption
CompressionOption

A opção de compactação do pacote.The package compression option.

Exemplos

O exemplo a seguir mostra como criar e fechar um XpsDocument.The following example shows how to create and close an XpsDocument.

// Create an XpsDocument package (without PrintTicket).
{
   Package^ package = Package::Open(packageName);
   try
   {
      XpsDocument^ xpsDocument = gcnew XpsDocument(package);

      // Add the package content (false=without PrintTicket).
      AddPackageContent(xpsDocument, false);

      // Close the package.
      xpsDocument->Close();
   } finally
   {
      delete package;
   }
// Create an XpsDocument package (without PrintTicket).
using (Package package = Package.Open(packageName))
{
    XpsDocument xpsDocument = new XpsDocument(package);

    // Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, false);

    // Close the package.
    xpsDocument.Close();
}
' Create an XpsDocument package (without PrintTicket).
Using package1 As Package = Package.Open(packageName)
    Dim xpsDocument As New XpsDocument(package1)

    ' Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, False)

    ' Close the package.
    xpsDocument.Close()
End Using

O exemplo a seguir também mostra como criar e fechar um XpsDocument.The following example also shows how to create and close an XpsDocument.

// Save as a WordXML document.
WordXmlSerializer.SaveToFile(fileName, flowDocument.ContentStart, flowDocument.ContentEnd);
return true;

XpsDocument(String, FileAccess)

Inicializa uma nova instância da classe XpsDocument contida em um arquivo Package especificado com as opções de compactação, recurso e intercalação padrão.Initializes a new instance of the XpsDocument class that is contained in a specified Package file with default interleaving, resource, and compression options.

public:
 XpsDocument(System::String ^ path, System::IO::FileAccess packageAccess);
public XpsDocument (string path, System.IO.FileAccess packageAccess);
new System.Windows.Xps.Packaging.XpsDocument : string * System.IO.FileAccess -> System.Windows.Xps.Packaging.XpsDocument
Public Sub New (path As String, packageAccess As FileAccess)

Parâmetros

path
String

O caminho e o nome de arquivo do Package de destino para o XpsDocument.The path and file name of the target Package for the XpsDocument.

packageAccess
FileAccess

O modo de E/S do arquivo no qual abrir o XpsDocument.The file I/O mode in which to open the XpsDocument.

Exemplos

O exemplo a seguir mostra como criar e fechar um XpsDocument.The following example shows how to create and close an XpsDocument.

// Create an XpsDocument package (without PrintTicket).
{
   Package^ package = Package::Open(packageName);
   try
   {
      XpsDocument^ xpsDocument = gcnew XpsDocument(package);

      // Add the package content (false=without PrintTicket).
      AddPackageContent(xpsDocument, false);

      // Close the package.
      xpsDocument->Close();
   } finally
   {
      delete package;
   }
// Create an XpsDocument package (without PrintTicket).
using (Package package = Package.Open(packageName))
{
    XpsDocument xpsDocument = new XpsDocument(package);

    // Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, false);

    // Close the package.
    xpsDocument.Close();
}
' Create an XpsDocument package (without PrintTicket).
Using package1 As Package = Package.Open(packageName)
    Dim xpsDocument As New XpsDocument(package1)

    ' Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, False)

    ' Close the package.
    xpsDocument.Close()
End Using

O exemplo a seguir também mostra como criar e fechar um XpsDocument.The following example also shows how to create and close an XpsDocument.

// Save as a WordXML document.
WordXmlSerializer.SaveToFile(fileName, flowDocument.ContentStart, flowDocument.ContentEnd);
return true;

XpsDocument(Package, CompressionOption, String)

Inicializa uma nova instância da classe XpsDocument contida em um Package especificado com as opções de compactação, recurso e intercalação padrão especificadas.Initializes a new instance of the XpsDocument class that is contained in a specified Package with the specified default interleaving, resource, and compression options.

public:
 XpsDocument(System::IO::Packaging::Package ^ package, System::IO::Packaging::CompressionOption compressionOption, System::String ^ path);
public XpsDocument (System.IO.Packaging.Package package, System.IO.Packaging.CompressionOption compressionOption, string path);
new System.Windows.Xps.Packaging.XpsDocument : System.IO.Packaging.Package * System.IO.Packaging.CompressionOption * string -> System.Windows.Xps.Packaging.XpsDocument

Parâmetros

package
Package

O pacote de destino para XpsDocument.The target package for the XpsDocument.

compressionOption
CompressionOption

A opção de compactação do pacote.The package compression option.

path
String

O URI (Uniform Resource Identifier) do documento como uma cadeia de caracteres.The uniform resource identifier (URI) for the document as a string.

Exemplos

O exemplo a seguir mostra como criar e fechar um XpsDocument.The following example shows how to create and close an XpsDocument.

// Create an XpsDocument package (without PrintTicket).
{
   Package^ package = Package::Open(packageName);
   try
   {
      XpsDocument^ xpsDocument = gcnew XpsDocument(package);

      // Add the package content (false=without PrintTicket).
      AddPackageContent(xpsDocument, false);

      // Close the package.
      xpsDocument->Close();
   } finally
   {
      delete package;
   }
// Create an XpsDocument package (without PrintTicket).
using (Package package = Package.Open(packageName))
{
    XpsDocument xpsDocument = new XpsDocument(package);

    // Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, false);

    // Close the package.
    xpsDocument.Close();
}
' Create an XpsDocument package (without PrintTicket).
Using package1 As Package = Package.Open(packageName)
    Dim xpsDocument As New XpsDocument(package1)

    ' Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, False)

    ' Close the package.
    xpsDocument.Close()
End Using

O exemplo a seguir também mostra como criar e fechar um XpsDocument.The following example also shows how to create and close an XpsDocument.

// Save as a WordXML document.
WordXmlSerializer.SaveToFile(fileName, flowDocument.ContentStart, flowDocument.ContentEnd);
return true;

XpsDocument(String, FileAccess, CompressionOption)

Inicializa uma nova instância da classe XpsDocument contida em um arquivo Package especificado com as opções de compactação, recurso e intercalação padrão.Initializes a new instance of the XpsDocument class that is contained in a specified Package file with default interleaving, resource, and compression options.

public:
 XpsDocument(System::String ^ path, System::IO::FileAccess packageAccess, System::IO::Packaging::CompressionOption compressionOption);
public XpsDocument (string path, System.IO.FileAccess packageAccess, System.IO.Packaging.CompressionOption compressionOption);
new System.Windows.Xps.Packaging.XpsDocument : string * System.IO.FileAccess * System.IO.Packaging.CompressionOption -> System.Windows.Xps.Packaging.XpsDocument

Parâmetros

path
String

O caminho e o nome de arquivo do Package de destino para o XpsDocument.The path and file name of the target Package for the XpsDocument.

packageAccess
FileAccess

O modo de E/S do arquivo no qual abrir o XpsDocument.The file I/O mode in which to open the XpsDocument.

compressionOption
CompressionOption

A opção de compactação do pacote.The package compression option.

Exemplos

O exemplo a seguir mostra como criar e fechar um XpsDocument.The following example shows how to create and close an XpsDocument.

// Create an XpsDocument package (without PrintTicket).
{
   Package^ package = Package::Open(packageName);
   try
   {
      XpsDocument^ xpsDocument = gcnew XpsDocument(package);

      // Add the package content (false=without PrintTicket).
      AddPackageContent(xpsDocument, false);

      // Close the package.
      xpsDocument->Close();
   } finally
   {
      delete package;
   }
// Create an XpsDocument package (without PrintTicket).
using (Package package = Package.Open(packageName))
{
    XpsDocument xpsDocument = new XpsDocument(package);

    // Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, false);

    // Close the package.
    xpsDocument.Close();
}
' Create an XpsDocument package (without PrintTicket).
Using package1 As Package = Package.Open(packageName)
    Dim xpsDocument As New XpsDocument(package1)

    ' Add the package content (false=without PrintTicket).
    AddPackageContent(xpsDocument, False)

    ' Close the package.
    xpsDocument.Close()
End Using

O exemplo a seguir também mostra como criar e fechar um XpsDocument.The following example also shows how to create and close an XpsDocument.

// Save as a WordXML document.
WordXmlSerializer.SaveToFile(fileName, flowDocument.ContentStart, flowDocument.ContentEnd);
return true;

Aplica-se a