summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Rasmussen <sebras@hotmail.com>2008-12-06 13:14:01 +0100
committerSebastian Rasmussen <sebras@hotmail.com>2008-12-06 13:14:01 +0100
commit2111f705cbbd1a59ba9ff53d56bcd222d71d4d6a (patch)
tree49a327b5b51581cca3944ef3c56f78564350502d
parent437cbd06c8b5c7b8dafc3847a35fb607d15ad297 (diff)
downloadmupdf-2111f705cbbd1a59ba9ff53d56bcd222d71d4d6a.tar.xz
Add interface to retrieve page object reference.
-rw-r--r--include/mupdf/page.h1
-rw-r--r--mupdf/pdf_pagetree.c8
2 files changed, 9 insertions, 0 deletions
diff --git a/include/mupdf/page.h b/include/mupdf/page.h
index 57aae34a..85065765 100644
--- a/include/mupdf/page.h
+++ b/include/mupdf/page.h
@@ -42,6 +42,7 @@ struct pdf_textline_s
fz_error *pdf_loadpagetree(pdf_pagetree **pp, pdf_xref *xref);
int pdf_getpagecount(pdf_pagetree *pages);
fz_obj *pdf_getpageobject(pdf_pagetree *pages, int p);
+fz_obj *pdf_getpagereference(pdf_pagetree *pages, int p);
void pdf_debugpagetree(pdf_pagetree *pages);
void pdf_droppagetree(pdf_pagetree *pages);
diff --git a/mupdf/pdf_pagetree.c b/mupdf/pdf_pagetree.c
index c27738bc..dc241476 100644
--- a/mupdf/pdf_pagetree.c
+++ b/mupdf/pdf_pagetree.c
@@ -228,6 +228,14 @@ pdf_getpageobject(pdf_pagetree *pages, int p)
return pages->pobj[p];
}
+fz_obj *
+pdf_getpagereference(pdf_pagetree *pages, int p)
+{
+ if (p < 0 || p >= pages->count)
+ return nil;
+ return pages->pref[p];
+}
+
void
pdf_droppagetree(pdf_pagetree *pages)
{