def resolve_all(x, default=None):
while isinstance(x, PDFObjRef):<EOL><INDENT>x = x.resolve(default=default)<EOL><DEDENT>if isinstance(x, list):<EOL><INDENT>x = [resolve_all(v, default=default) for v in x]<EOL><DEDENT>elif isinstance(x, dict):<EOL><INDENT>for (k, v) in x.iteritems():<EOL><INDENT>x[k] = resolve_all(v, default=default)<EOL><DEDENT><DEDENT>return x<EOL>
Recursively resolves the given object and all the internals.

    Make sure there is no indirect reference within the nested object.
    This procedure might be slow.