XpsDocument Constructor (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.

Namespace:   System.Windows.Xps.Packaging
Assembly:  ReachFramework (in ReachFramework.dll)

public XpsDocument(
	Package package
)

Parameters

package
Type: System.IO.Packaging.Package

The target XPS package for the XpsDocument.

The following example shows how to create and close an XpsDocument.

// 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();
}

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;

.NET Framework
Available since 3.0
Return to top
Show: