diff options
Diffstat (limited to 'source/pdf/pdf-object.c')
-rw-r--r-- | source/pdf/pdf-object.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source/pdf/pdf-object.c b/source/pdf/pdf-object.c index 406580b2..10a16c8a 100644 --- a/source/pdf/pdf-object.c +++ b/source/pdf/pdf-object.c @@ -388,6 +388,19 @@ pdf_document *pdf_get_indirect_document(fz_context *ctx, pdf_obj *obj) return REF(obj)->doc; } +pdf_document *pdf_get_bound_document(fz_context *ctx, pdf_obj *obj) +{ + if (obj < PDF_OBJ__LIMIT) + return NULL; + if (obj->kind == PDF_INDIRECT) + return REF(obj)->doc; + if (obj->kind == PDF_ARRAY) + return ARRAY(obj)->doc; + if (obj->kind == PDF_DICT) + return DICT(obj)->doc; + return NULL; +} + int pdf_objcmp_resolve(fz_context *ctx, pdf_obj *a, pdf_obj *b) { RESOLVE(a); |