Partager via


IXpsOMPackage1::GetDocumentType method

Gets the document type of the data that was used to initialize this package. This method is used to determine whether a document is the XPS or OpenXPS type. For more information, see XPS Documents.

Syntax

HRESULT GetDocumentType(
   [out, retval] XPS_DOCUMENT_TYPE * documentType
);

Parameters

  • documentType
    [out, retval] The document type of the source data used to initialize this package. A document type value of XPS_DOCUMENT_TYPE_UNSPECIFIED is returned if the package was created in memory.

Return value

The method returns an HRESULT. Possible values include, but are not limited to, the following values. For information about XPS Document API return values that are not listed in this table, see XPS Document Errors.

S_OK: The method succeeded.

E_POINTER: documentType is NULL.

Remarks

If the IXpsOMPackage1 instance was not loaded from a stream or a file, the document type is unspecified (XPS_DOCUMENT_TYPE_UNSPECIFIED). Otherwise, the document type returned is that of the stream or file used to initialize the IXpsOMPackage1 instance.

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

IXpsOMPackage1

XPS Documents