XpsDocument XpsDocument XpsDocument XpsDocument Constructors

Definition

Overloads

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

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)

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) XpsDocument(String, FileAccess) XpsDocument(String, FileAccess) XpsDocument(String, FileAccess)

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) XpsDocument(Package, CompressionOption, String) XpsDocument(Package, CompressionOption, String)

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) XpsDocument(String, FileAccess, CompressionOption) XpsDocument(String, FileAccess, CompressionOption)

Initializes a new instance of the XpsDocument class that is contained in a specified Package file with default interleaving, resource, and compression options.

Examples

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

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) XpsDocument(Package) XpsDocument(Package)

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

Parameters

package
Package Package Package Package

The target XPS package for the XpsDocument.

Examples

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

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) XpsDocument(Package, CompressionOption) XpsDocument(Package, CompressionOption)

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

Parameters

package
Package Package Package Package

The target package for the XpsDocument.

compressionOption
CompressionOption CompressionOption CompressionOption CompressionOption

The package compression option.

Examples

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

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) XpsDocument(String, FileAccess) XpsDocument(String, FileAccess) XpsDocument(String, FileAccess)

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)

Parameters

path
String String String String

The path and file name of the target Package for the XpsDocument.

packageAccess
FileAccess FileAccess FileAccess FileAccess

The file I/O mode in which to open the XpsDocument.

Examples

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

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) XpsDocument(Package, CompressionOption, String) XpsDocument(Package, CompressionOption, String)

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

Parameters

package
Package Package Package Package

The target package for the XpsDocument.

compressionOption
CompressionOption CompressionOption CompressionOption CompressionOption

The package compression option.

path
String String String String

The uniform resource identifier (URI) for the document as a string.

Examples

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

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) XpsDocument(String, FileAccess, CompressionOption) XpsDocument(String, FileAccess, CompressionOption)

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

Parameters

path
String String String String

The path and file name of the target Package for the XpsDocument.

packageAccess
FileAccess FileAccess FileAccess FileAccess

The file I/O mode in which to open the XpsDocument.

compressionOption
CompressionOption CompressionOption CompressionOption CompressionOption

The package compression option.

Examples

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

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;

Applies to