diff options
author | Tor Andersson <tor.andersson@artifex.com> | 2016-03-01 20:19:16 +0100 |
---|---|---|
committer | Tor Andersson <tor.andersson@artifex.com> | 2016-03-01 21:57:42 +0100 |
commit | 3fe81c6eadc24068e8bbb3d79ae38beea34d7d6f (patch) | |
tree | cbf1e36b935382072f2ba9c0f24ae9f29fb1b465 /source/pdf | |
parent | f8751e3c36525a4ce69242c36b89e7d7116ffac2 (diff) | |
download | mupdf-3fe81c6eadc24068e8bbb3d79ae38beea34d7d6f.tar.xz |
js: Add PDF document and object access.
Diffstat (limited to 'source/pdf')
-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); |