Język

XpsDocument Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy XpsDocument.

Przeciążenia

Nazwa Opis
XpsDocument(Package)

Inicjuje nowe wystąpienie XpsDocument klasy z dostępem do określonej specyfikacji papieru XML (XPS) Package i domyślnych przeplatania, zasobów i opcji kompresji.

XpsDocument(Package, CompressionOption)

Inicjuje nowe wystąpienie XpsDocument klasy, która jest zawarta w określonym Package domyślnym przeplataniu, zasobie i opcjach kompresji.

XpsDocument(String, FileAccess)

Inicjuje nowe wystąpienie XpsDocument klasy, która znajduje się w określonym Package pliku z domyślnymi opcjami przeplatania, zasobów i kompresji.

XpsDocument(Package, CompressionOption, String)

Inicjuje nowe wystąpienie XpsDocument klasy, która jest zawarta w określonym Package z określonym domyślnym przeplataniami, zasobami i opcjami kompresji.

XpsDocument(String, FileAccess, CompressionOption)

Inicjuje nowe wystąpienie XpsDocument klasy, która znajduje się w określonym Package pliku z domyślnymi opcjami przeplatania, zasobów i kompresji.

Przykłady

W poniższym przykładzie pokazano, jak utworzyć i zamknąć obiekt 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

W poniższym przykładzie pokazano również, jak utworzyć i zamknąć obiekt XpsDocument.

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

XpsDocument(Package)

Inicjuje nowe wystąpienie XpsDocument klasy z dostępem do określonej specyfikacji papieru XML (XPS) Package i domyślnych przeplatania, zasobów i opcji kompresji.

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)

Parametry

package
Package

Docelowy pakiet XPS dla elementu XpsDocument.

Przykłady

W poniższym przykładzie pokazano, jak utworzyć i zamknąć obiekt 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

W poniższym przykładzie pokazano również, jak utworzyć i zamknąć obiekt XpsDocument.

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

Dotyczy

XpsDocument(Package, CompressionOption)

Inicjuje nowe wystąpienie XpsDocument klasy, która jest zawarta w określonym Package domyślnym przeplataniu, zasobie i opcjach kompresji.

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)

Parametry

package
Package

Pakiet docelowy dla elementu XpsDocument.

compressionOption
CompressionOption

Opcja kompresji pakietu.

Przykłady

W poniższym przykładzie pokazano, jak utworzyć i zamknąć obiekt 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

W poniższym przykładzie pokazano również, jak utworzyć i zamknąć obiekt XpsDocument.

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

Dotyczy

XpsDocument(String, FileAccess)

Inicjuje nowe wystąpienie XpsDocument klasy, która znajduje się w określonym Package pliku z domyślnymi opcjami przeplatania, zasobów i kompresji.

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)

Parametry

path
String

Ścieżka i nazwa pliku obiektu docelowego Package dla elementu XpsDocument.

packageAccess
FileAccess

Tryb we/wy pliku, w którym należy otworzyć XpsDocumentplik .

Przykłady

W poniższym przykładzie pokazano, jak utworzyć i zamknąć obiekt 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

W poniższym przykładzie pokazano również, jak utworzyć i zamknąć obiekt XpsDocument.

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

Dotyczy

XpsDocument(Package, CompressionOption, String)

Inicjuje nowe wystąpienie XpsDocument klasy, która jest zawarta w określonym Package z określonym domyślnym przeplataniami, zasobami i opcjami kompresji.

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)

Parametry

package
Package

Pakiet docelowy dla elementu XpsDocument.

compressionOption
CompressionOption

Opcja kompresji pakietu.

path
String

Jednolity identyfikator zasobu (URI) dla dokumentu jako ciąg.

Przykłady

W poniższym przykładzie pokazano, jak utworzyć i zamknąć obiekt 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

W poniższym przykładzie pokazano również, jak utworzyć i zamknąć obiekt XpsDocument.

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

Dotyczy

XpsDocument(String, FileAccess, CompressionOption)

Inicjuje nowe wystąpienie XpsDocument klasy, która znajduje się w określonym Package pliku z domyślnymi opcjami przeplatania, zasobów i kompresji.

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)

Parametry

path
String

Ścieżka i nazwa pliku obiektu docelowego Package dla elementu XpsDocument.

packageAccess
FileAccess

Tryb we/wy pliku, w którym należy otworzyć XpsDocumentplik .

compressionOption
CompressionOption

Opcja kompresji pakietu.

Przykłady

W poniższym przykładzie pokazano, jak utworzyć i zamknąć obiekt 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

W poniższym przykładzie pokazano również, jak utworzyć i zamknąć obiekt XpsDocument.

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

Dotyczy