def resolve_all(x):
 while isinstance(x, PDFObjRef):
  x = x.resolve()
 if isinstance(x, list):
  x = [resolve_all(v) for v in x]
 elif isinstance(x, dict):
  for (k, v) in x.iteritems():
   x[k] = resolve_all(v)
 return x

def resolve_all ( x ) : while isinstance ( x , PDFObjRef ) : x = x . resolve ( ) if isinstance ( x , list ) : x = [ resolve_all ( v ) for v in x ] elif isinstance ( x , dict ) : for ( k , v ) in x . iteritems ( ) : x [ k ] = resolve_all ( v ) return x
recursively resolves the given object and all the internals .