# 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;
    }

© Copyright 2006-2020 Micro Focus or one of its affiliates | Send documentation feedback Close Send documentation feedback To open the configured email client on this computer, open an email window. Otherwise, copy the information below to a mail client, and then send this email to swpdl.idoldocsfeedback@microfocus.com. We appreciate your feedback! Product: Topic Title: Help Topic: Feedback:

_FT_HTML5_bannerTitle.htm