I am trying to extract the language of any general pdf document and set it in CMS using python. I am trying to extract it using /Lang attribute, here is the code sample:

```
pdfFileLang = findInDict('/Lang',pdfFile.resolvedObjects())

def findInDict(needle,indirectObjectDict):
    """ Returns the PDF Language """
    haystack = indirectObjectDict[0]
    LOG('pypdfutils.py getPdfLanguage key haystack',INFO,str(haystack))
    for key in haystack.keys():
        LOG('pypdfutils.py getPdfLanguage key',INFO,str(key))
        try:
             value = haystack[key]
             LOG('pypdfutils.py getPdfLanguage value',INFO,str(value))
             if key == needle:
                 return value
             else:
                 LOG('pypdfutils.py getPdfLanguage value1',INFO,str(value))
             internalDict = value.keys()
             LOG('pypdfutils.py getPdfLanguage key Dict',INFO,str(internalDict))
             if type(value) == types.DictType:
                 internalDict = value.keys()                 
             else:
                 LOG('pypdfutils.py getPdfLanguage value2',INFO,str(value))
                 for internalkey in internalDict.keys():
                     internalvalue = internalDict[internalkey]
                     LOG('pypdfutils.py getPdfLanguage key internalvalue',INFO,str(internalvalue))
                     if type(internalvalue) == types.DictType and internalvalue.has_key(needle):
                         return internalvalue[needle]                                  
        except Exception,e:
            LOG('pypdfutils.py getPdfLanguage',INFO,str(e))
            continue

```

But when I am seeing the LOGS I find no such attribute "/Lang" in the dictionary.