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.
(x)
| 61 | return x |
| 62 | |
| 63 | def resolve_all(x): |
| 64 | """Recursively resolves the given object and all the internals. |
| 65 | |
| 66 | Make sure there is no indirect reference within the nested object. |
| 67 | This procedure might be slow. |
| 68 | """ |
| 69 | while isinstance(x, PDFObjRef): |
| 70 | x = x.resolve() |
| 71 | if isinstance(x, list): |
| 72 | x = [ resolve_all(v) for v in x ] |
| 73 | elif isinstance(x, dict): |
| 74 | for (k,v) in x.iteritems(): |
| 75 | x[k] = resolve_all(v) |
| 76 | return x |
| 77 | |
| 78 | def decipher_all(decipher, objid, genno, x): |
| 79 | """Recursively deciphers the given object. |