Logo Search packages:      
Sourcecode: libpodofo version File versions  Download package

const char * PoDoFo::PdfError::ErrorMessage ( EPdfError  eCode ) [static]

Get the error message for a certain error code.

Returns:
the error message or NULL if no error message for the specified error code is available.

Definition at line 337 of file PdfError.cpp.

References PoDoFo::ePdfError_ActionAlreadyPresent, PoDoFo::ePdfError_CannotConvertColor, PoDoFo::ePdfError_ChangeOnImmutable, PoDoFo::ePdfError_Date, PoDoFo::ePdfError_DestinationAlreadyPresent, PoDoFo::ePdfError_ErrOk, PoDoFo::ePdfError_FileNotFound, PoDoFo::ePdfError_Flate, PoDoFo::ePdfError_FreeType, PoDoFo::ePdfError_InternalLogic, PoDoFo::ePdfError_InvalidContentStream, PoDoFo::ePdfError_InvalidDataType, PoDoFo::ePdfError_InvalidDeviceOperation, PoDoFo::ePdfError_InvalidEncryptionDict, PoDoFo::ePdfError_InvalidEnumValue, PoDoFo::ePdfError_InvalidFontFile, PoDoFo::ePdfError_InvalidHandle, PoDoFo::ePdfError_InvalidHexString, PoDoFo::ePdfError_InvalidKey, PoDoFo::ePdfError_InvalidLinearization, PoDoFo::ePdfError_InvalidName, PoDoFo::ePdfError_InvalidPassword, PoDoFo::ePdfError_InvalidPredictor, PoDoFo::ePdfError_InvalidStream, PoDoFo::ePdfError_InvalidStreamLength, PoDoFo::ePdfError_InvalidStrokeStyle, PoDoFo::ePdfError_InvalidTrailerSize, PoDoFo::ePdfError_InvalidXRef, PoDoFo::ePdfError_InvalidXRefStream, PoDoFo::ePdfError_InvalidXRefType, PoDoFo::ePdfError_MissingEndStream, PoDoFo::ePdfError_MutexError, PoDoFo::ePdfError_NoNumber, PoDoFo::ePdfError_NoObject, PoDoFo::ePdfError_NoPdfFile, PoDoFo::ePdfError_NotImplemented, PoDoFo::ePdfError_NoTrailer, PoDoFo::ePdfError_NoXRef, PoDoFo::ePdfError_OutOfMemory, PoDoFo::ePdfError_PageNotFound, PoDoFo::ePdfError_SignatureError, PoDoFo::ePdfError_TestFailed, PoDoFo::ePdfError_UnexpectedEOF, PoDoFo::ePdfError_Unknown, PoDoFo::ePdfError_UnsupportedFilter, PoDoFo::ePdfError_UnsupportedFontFormat, PoDoFo::ePdfError_UnsupportedImageFormat, PoDoFo::ePdfError_ValueOutOfRange, and PoDoFo::ePdfError_WrongDestinationType.

Referenced by PrintErrorMsg(), and PoDoFo::Impose::PdfTranslator::setSource().

{
    const char* pszMsg = NULL;

    switch( eCode ) 
    {
        case ePdfError_ErrOk:
            pszMsg = "No error during execution.";
            break;
        case ePdfError_TestFailed:
            pszMsg = "An error curred in an automatic test included in PoDoFo.";
            break;
        case ePdfError_InvalidHandle:
            pszMsg = "A NULL handle was passed, but initialized data was expected.";
            break;
        case ePdfError_FileNotFound:
            pszMsg = "The specified file was not found.";
            break;
        case ePdfError_InvalidDeviceOperation:
            pszMsg = "Tried to do something unsupported to an I/O device like seek a non-seekable input device";
            break;
        case ePdfError_UnexpectedEOF:
            pszMsg = "End of file was reached unxexpectedly.";
            break;
        case ePdfError_OutOfMemory:
            pszMsg = "PoDoFo is out of memory.";
            break;
        case ePdfError_ValueOutOfRange:
            pszMsg = "The passed value is out of range.";
            break;
        case ePdfError_InternalLogic:
            pszMsg = "An internal error occurred.";
            break;
        case ePdfError_InvalidEnumValue:
            pszMsg = "An invalid enum value was specified.";
            break;
        case ePdfError_PageNotFound:
            pszMsg = "The requested page could not be found in the PDF.";
            break;
        case ePdfError_NoPdfFile:
            pszMsg = "This is not a PDF file.";
            break;
        case ePdfError_NoXRef:
            pszMsg = "No XRef table was found in the PDF file.";
            break;
        case ePdfError_NoTrailer:
            pszMsg = "No trailer was found in the PDF file.";
            break;
        case ePdfError_NoNumber:
            pszMsg = "A number was expected but not found.";
            break;
        case ePdfError_NoObject:
            pszMsg = "A object was expected but not found.";
            break;

        case ePdfError_InvalidTrailerSize:
        case ePdfError_InvalidLinearization:
        case ePdfError_InvalidDataType:
        case ePdfError_InvalidXRef:
        case ePdfError_InvalidXRefStream:
        case ePdfError_InvalidXRefType:
        case ePdfError_InvalidPredictor:
        case ePdfError_InvalidStrokeStyle:
        case ePdfError_InvalidHexString:
        case ePdfError_InvalidStream:
        case ePdfError_InvalidStreamLength:
        case ePdfError_InvalidKey:
        case ePdfError_InvalidName:
            break;
        case ePdfError_InvalidEncryptionDict:
            pszMsg = "The encryption dictionary is invalid or misses a required key.";
            break;
        case ePdfError_InvalidPassword:
            pszMsg = "The password used to open the PDF file was invalid.";
            break;
        case ePdfError_InvalidFontFile:
            pszMsg = "The font file is invalid.";
            break;
        case ePdfError_InvalidContentStream:
            pszMsg = "The content stream is invalid due to mismatched context pairing or other problems.";
            break;
        case ePdfError_UnsupportedFilter:
            break;
        case ePdfError_UnsupportedFontFormat:
            pszMsg = "This font format is not supported by PoDoFO.";
            break;
        case ePdfError_DestinationAlreadyPresent:
        case ePdfError_ActionAlreadyPresent:
            pszMsg = "Outlines can have either destinations or actions."; 
            break;
        case ePdfError_WrongDestinationType:
            pszMsg = "The requested field is not available for the given destination type";
            break;
        case ePdfError_MissingEndStream:
        case ePdfError_Date:
            break;
        case ePdfError_Flate:
            pszMsg = "ZLib returned an error.";
            break;
        case ePdfError_FreeType:
            pszMsg = "FreeType returned an error.";
            break;
        case ePdfError_SignatureError:
            pszMsg = "The signature contains an error.";
            break;
        case ePdfError_MutexError:
            pszMsg = "Error during a mutex operation.";
            break;
        case ePdfError_UnsupportedImageFormat:
            pszMsg = "This image format is not supported by PoDoFO.";
            break;
        case ePdfError_CannotConvertColor:
            pszMsg = "This color format cannot be converted.";
            break;
        case ePdfError_ChangeOnImmutable:
            pszMsg = "Changing values on immutable objects is not allowed.";
            break;
        case ePdfError_NotImplemented:
            pszMsg = "This feature is currently not implemented.";
            break;
        case ePdfError_Unknown:
            pszMsg = "Error code unknown.";
            break;
        default:
            break;
    }

    return pszMsg;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index