IXpsOMObjectFactory1::GetDocumentTypeFromStream method

Detects the type of XPS document that is stored in the specified stream.

Syntax

HRESULT GetDocumentTypeFromStream(
   [in] IStream *                    xpsDocumentStream,
   [out, retval] XPS_DOCUMENT_TYPE * documentType
);

Parameters

  • xpsDocumentStream
    [in] A stream that contains XPS OM data. The stream must support sequential reading and the read position of the stream must be set to the beginning of the XPS data.

  • documentType
    [out, retval] The document type of the XPS data found in the stream.

Return value

Possible values include, but are not limited to, the following. For information about XPS document API return values that are not listed here, see XPS Document Errors.

S_OK: The document type is XPS_DOCUMENT_TYPE_ XPS or XPS_DOCUMENT_TYPE_ OPENXPS.

Remarks

This method only parses the data enough to detect the document type. It does not validate the content. A return value of S_OK does not, therefore, imply that the stream contains a valid document.

Requirements

Minimum supported client

Windows 8 [desktop apps | Windows Store apps]

Minimum supported server

Windows Server 2012 [desktop apps | Windows Store apps]

Header

XpsObjectModel_1.h

IDL

XpsObjectModel.idl

Library

None

See also

IXpsOMObjectFactory1