summaryrefslogtreecommitdiff
path: root/source/tools
diff options
context:
space:
mode:
Diffstat (limited to 'source/tools')
-rw-r--r--source/tools/pdfclean.c4
-rw-r--r--source/tools/pdfinfo.c8
-rw-r--r--source/tools/pdfposter.c2
-rw-r--r--source/tools/pdfshow.c2
4 files changed, 8 insertions, 8 deletions
diff --git a/source/tools/pdfclean.c b/source/tools/pdfclean.c
index f42269a8..dc8a1f38 100644
--- a/source/tools/pdfclean.c
+++ b/source/tools/pdfclean.c
@@ -91,8 +91,8 @@ static void retainpages(int argc, char **argv)
for (page = spage; page <= epage; page++)
{
- pdf_obj *pageobj = doc->page_objs[page-1];
- pdf_obj *pageref = doc->page_refs[page-1];
+ pdf_obj *pageref = pdf_lookup_page_obj(doc, page-1);
+ pdf_obj *pageobj = pdf_resolve_indirect(pageref);
pdf_dict_puts(pageobj, "Parent", parent);
diff --git a/source/tools/pdfinfo.c b/source/tools/pdfinfo.c
index 18417452..856029ba 100644
--- a/source/tools/pdfinfo.c
+++ b/source/tools/pdfinfo.c
@@ -572,8 +572,8 @@ gatherresourceinfo(int page, pdf_obj *rsrc, int show)
pdf_obj *subrsrc;
int i;
- pageobj = doc->page_objs[page-1];
- pageref = doc->page_refs[page-1];
+ pageref = pdf_lookup_page_obj(doc, page-1);
+ pageobj = pdf_resolve_indirect(pageref);
if (!pageobj)
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot retrieve info from page %d", page);
@@ -640,8 +640,8 @@ gatherpageinfo(int page, int show)
pdf_obj *pageref;
pdf_obj *rsrc;
- pageobj = doc->page_objs[page-1];
- pageref = doc->page_refs[page-1];
+ pageref = pdf_lookup_page_obj(doc, page-1);
+ pageobj = pdf_resolve_indirect(pageref);
if (!pageobj)
fz_throw(ctx, FZ_ERROR_GENERIC, "cannot retrieve info from page %d", page);
diff --git a/source/tools/pdfposter.c b/source/tools/pdfposter.c
index 4702c2aa..3076f7af 100644
--- a/source/tools/pdfposter.c
+++ b/source/tools/pdfposter.c
@@ -81,7 +81,7 @@ static void decimatepages(pdf_document *doc)
fz_rect mb;
int num;
- newpageobj = pdf_copy_dict(doc->page_objs[page]);
+ newpageobj = pdf_copy_dict(pdf_lookup_page_obj(doc, page));
num = pdf_create_object(doc);
pdf_update_object(doc, num, newpageobj);
newpageref = pdf_new_indirect(doc, num, 0);
diff --git a/source/tools/pdfshow.c b/source/tools/pdfshow.c
index 78e3fd08..6e721464 100644
--- a/source/tools/pdfshow.c
+++ b/source/tools/pdfshow.c
@@ -62,7 +62,7 @@ static void showpagetree(void)
count = pdf_count_pages(doc);
for (i = 0; i < count; i++)
{
- ref = doc->page_refs[i];
+ ref = pdf_lookup_page_obj(doc, i);
printf("page %d = %d %d R\n", i + 1, pdf_to_num(ref), pdf_to_gen(ref));
}
printf("\n");