XpsDocument Constructores

Definición

Inicializa una nueva instancia de la clase XpsDocument.Initializes a new instance of the XpsDocument class.

Sobrecargas

XpsDocument(Package)

Inicializa una instancia nueva de la clase XpsDocument con acceso a un objeto Package de XML Paper Specification (XPS) especificado y a las opciones predeterminadas de intercalación, recurso y compresión.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 una nueva instancia de la clase XpsDocument contenida en un Package especificado con las opciones predeterminadas de intercalación, recurso y compresión 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 una nueva instancia de la clase XpsDocument contenida en un archivo Package especificado con las opciones predeterminadas de intercalación, recurso y compresión.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 una nueva instancia de la clase XpsDocument contenida en un Package especificado con las opciones predeterminadas de intercalación, recurso y compresión 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 una nueva instancia de la clase XpsDocument contenida en un archivo Package especificado con las opciones predeterminadas de intercalación, recurso y compresión.Initializes a new instance of the XpsDocument class that is contained in a specified Package file with default interleaving, resource, and compression options.

Ejemplos

En el ejemplo siguiente se muestra cómo crear y cerrar un 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

En el ejemplo siguiente también se muestra cómo crear y cerrar un 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 una instancia nueva de la clase XpsDocument con acceso a un objeto Package de XML Paper Specification (XPS) especificado y a las opciones predeterminadas de intercalación, recurso y compresión.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
Public Sub New (package As Package)

Parámetros

package
Package

El paquete XPS de destino para XpsDocument.The target XPS package for the XpsDocument.

Ejemplos

En el ejemplo siguiente se muestra cómo crear y cerrar un 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

En el ejemplo siguiente también se muestra cómo crear y cerrar un 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;

Se aplica a

XpsDocument(Package, CompressionOption)

Inicializa una nueva instancia de la clase XpsDocument contenida en un Package especificado con las opciones predeterminadas de intercalación, recurso y compresión 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
Public Sub New (package As Package, compressionOption As CompressionOption)

Parámetros

package
Package

El paquete de destino del XpsDocument.The target package for the XpsDocument.

compressionOption
CompressionOption

Opción de compresión del paquete.The package compression option.

Ejemplos

En el ejemplo siguiente se muestra cómo crear y cerrar un 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

En el ejemplo siguiente también se muestra cómo crear y cerrar un 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;

Se aplica a

XpsDocument(String, FileAccess)

Inicializa una nueva instancia de la clase XpsDocument contenida en un archivo Package especificado con las opciones predeterminadas de intercalación, recurso y compresión.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

La ruta de acceso y nombre de archivo del Package de destino del XpsDocument.The path and file name of the target Package for the XpsDocument.

packageAccess
FileAccess

Modo de entrada/salida de archivo en el que se va a abrir el XpsDocument.The file I/O mode in which to open the XpsDocument.

Ejemplos

En el ejemplo siguiente se muestra cómo crear y cerrar un 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

En el ejemplo siguiente también se muestra cómo crear y cerrar un 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;

Se aplica a

XpsDocument(Package, CompressionOption, String)

Inicializa una nueva instancia de la clase XpsDocument contenida en un Package especificado con las opciones predeterminadas de intercalación, recurso y compresión 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
Public Sub New (package As Package, compressionOption As CompressionOption, path As String)

Parámetros

package
Package

El paquete de destino del XpsDocument.The target package for the XpsDocument.

compressionOption
CompressionOption

Opción de compresión del paquete.The package compression option.

path
String

Identificador uniforme de recursos (URI) del documento como una cadena.The uniform resource identifier (URI) for the document as a string.

Ejemplos

En el ejemplo siguiente se muestra cómo crear y cerrar un 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

En el ejemplo siguiente también se muestra cómo crear y cerrar un 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;

Se aplica a

XpsDocument(String, FileAccess, CompressionOption)

Inicializa una nueva instancia de la clase XpsDocument contenida en un archivo Package especificado con las opciones predeterminadas de intercalación, recurso y compresión.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
Public Sub New (path As String, packageAccess As FileAccess, compressionOption As CompressionOption)

Parámetros

path
String

La ruta de acceso y nombre de archivo del Package de destino del XpsDocument.The path and file name of the target Package for the XpsDocument.

packageAccess
FileAccess

Modo de entrada/salida de archivo en el que se va a abrir el XpsDocument.The file I/O mode in which to open the XpsDocument.

compressionOption
CompressionOption

Opción de compresión del paquete.The package compression option.

Ejemplos

En el ejemplo siguiente se muestra cómo crear y cerrar un 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

En el ejemplo siguiente también se muestra cómo crear y cerrar un 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;

Se aplica a