# KVPDFState

This structure is returned by PDF export functions to indicate whether they were successful, and if they failed to give the reason why.

    typedef struct
    {
        KVErrorCode	eErrorCode;
        KVErrorCodeEx	eErrorCodeEx;
    }
    KVPDFState;

## Member Descriptions

`eErrorCode` | The error code returned by KeyView. This enumerated type is defined in `kverrorcodes.h`.
`eErrorCodeEx` | The extended error code returned by KeyView. This enumerated type is defined in `kverrorcodes.h`.

## Discussion

To evaluate a `KVPDFState` object, check `eErrorCode` first. A value of `KVERR_Success (0)` indicates success. Any other value indicates failure.

You can ignore `eErrorCodeEx` unless `eErrorCode` is `KVERR_General`. In this case, `eKVErrorCodeEx` might contain an extended error code that gives more information. If no more detail is available, `eKVErrorCodeEx` is set to 0.

## Example

In this example, a state object is used to obtain the error code as an integer.

    int convertStateToError(const KVPDFState state)
    {
    	if (state.eErrorCode == KVERR_General && state.eErrorCodeEx != (KVErrorCodeEx)0)
    	{
    		return state.eErrorCodeEx;
    	}

    	return state.eErrorCode;
    }

_FT_HTML5_bannerTitle.htm