IXpsOMPackage interface (xpsobjectmodel.h)

Provides the top-level entry into the XPS object model tree.

Although this interface does not correspond to any XPS markup, it does correspond to the XPS document, and it is required to save the components of an XPS object model tree as an XPS document.

Inheritance

The IXpsOMPackage interface inherits from the IUnknown interface. IXpsOMPackage also has these types of members:

Methods

The IXpsOMPackage interface has these methods.

 
IXpsOMPackage::GetCoreProperties

Gets a pointer to the IXpsOMCoreProperties interface of the XPS package.
IXpsOMPackage::GetDiscardControlPartName

Gets the name of the discard control part in the XPS package.
IXpsOMPackage::GetDocumentSequence

Gets a pointer to the IXpsOMDocumentSequence interface that contains the document sequence of the XPS package.
IXpsOMPackage::GetThumbnailResource

Gets a pointer to the IXpsOMImageResource interface of the thumbnail resource that is associated with the XPS package.
IXpsOMPackage::SetCoreProperties

Sets the IXpsOMCoreProperties interface of the XPS package.
IXpsOMPackage::SetDiscardControlPartName

Sets the name of the discard control part in the XPS package.
IXpsOMPackage::SetDocumentSequence

Sets the IXpsOMDocumentSequence interface of the XPS package.
IXpsOMPackage::SetThumbnailResource

Sets the thumbnail image of the XPS document.
IXpsOMPackage::WriteToFile

Writes the XPS package to a specified file.
IXpsOMPackage::WriteToStream

Writes the XPS package to a specified stream.

Remarks

The code example that follows illustrates how to create an instance of this interface.


IXpsOMPackage    *newInterface;

// Note the implicit requirement that CoInitializeEx 
//  has previously been called from this thread.

hr = CoCreateInstance(
      __uuidof(XpsOMObjectFactory),
      NULL, 
      CLSCTX_INPROC_SERVER,
      __uuidof(IXpsOMObjectFactory),
      reinterpret_cast<LPVOID*>(&xpsFactory)
      );

if (SUCCEEDED(hr))
{
    hr = xpsFactory->CreatePackage (&newInterface);
    if (SUCCEEDED(hr))
    {
        // use newInterface

        newInterface->Release();
    }

    xpsFactory->Release();
}
else
{
    // evaluate HRESULT error returned in hr
}

For information about using this interface in a program, see Create a Blank XPS OM.

Requirements

Requirement Value
Minimum supported client Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista [desktop apps | UWP apps]
Minimum supported server Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 [desktop apps | UWP apps]
Target Platform Windows
Header xpsobjectmodel.h

See also

Create a Blank XPS OM

IXpsOMObjectFactory::CreatePackage

IXpsOMObjectFactory::CreatePackageFromFile

IXpsOMObjectFactory::CreatePackageFromStream

Interfaces

XML Paper Specification