summaryrefslogtreecommitdiff
path: root/source/pdf/pdf-page.c
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-11-15 14:13:47 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-11-16 12:24:29 +0100
commit141870506d8809723e933963e9e001aca839cdfc (patch)
tree03c5b8a20ff1e53ecc9f55ca2030f0975d97bd9b /source/pdf/pdf-page.c
parentce90119c0102092e1d743b4a1ec88c40570ff7ac (diff)
downloadmupdf-141870506d8809723e933963e9e001aca839cdfc.tar.xz
pdf: Use '#page=N' for remote destination pages.
As per Adobe's recommendation: https://helpx.adobe.com/acrobat/kb/link-html-pdf-page-acrobat.html
Diffstat (limited to 'source/pdf/pdf-page.c')
-rw-r--r--source/pdf/pdf-page.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/source/pdf/pdf-page.c b/source/pdf/pdf-page.c
index 2112040a..8335614a 100644
--- a/source/pdf/pdf-page.c
+++ b/source/pdf/pdf-page.c
@@ -214,8 +214,16 @@ pdf_lookup_anchor(fz_context *ctx, pdf_document *doc, const char *name)
fz_catch(ctx)
fz_rethrow(ctx);
- uri = pdf_parse_link_dest(ctx, doc, dest);
- return pdf_resolve_link(ctx, doc, uri, NULL, NULL);
+ if (dest)
+ {
+ uri = pdf_parse_link_dest(ctx, doc, dest);
+ return pdf_resolve_link(ctx, doc, uri, NULL, NULL);
+ }
+
+ if (!strncmp(name, "page=", 5))
+ return fz_atoi(name + 5) - 1;
+
+ return fz_atoi(name) - 1;
}
static pdf_obj *