Freigeben über


IXpsOMObjectFactory1::GetDocumentTypeFromFile method

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

Syntax

HRESULT GetDocumentTypeFromFile(
   [in] LPCWSTR                      fileName,
   [out, retval] XPS_DOCUMENT_TYPE * documentType
);

Parameters

  • fileName
    [in] The name of the XPS file from which to get the type.

  • documentType
    [out, retval] The document type.

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 file 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