Export (0) Print
Expand All
0 out of 1 rated this helpful - Rate this topic

XpsDocument Constructor

Initializes a new instance of the XpsDocument class.

This member is overloaded. For complete information about this member, including syntax, usage, and examples, click a name in the overload list.

  Name Description
Public method 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 method 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 method 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 method 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 method 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.
Top

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;
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.