summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-object.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-03-01 20:19:16 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-03-01 21:57:42 +0100
commit3fe81c6eadc24068e8bbb3d79ae38beea34d7d6f (patch)
treecbf1e36b935382072f2ba9c0f24ae9f29fb1b465 /source/pdf/pdf-object.c
parentf8751e3c36525a4ce69242c36b89e7d7116ffac2 (diff)
downloadmupdf-3fe81c6eadc24068e8bbb3d79ae38beea34d7d6f.tar.xz
js: Add PDF document and object access.
Diffstat (limited to 'source/pdf/pdf-object.c')
-rw-r--r--source/pdf/pdf-object.c13
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);