From 0bfe9501ebc2e2a2329a5435100ef189b6166219 Mon Sep 17 00:00:00 2001 From: Sebastian Rasmussen Date: Sat, 24 Aug 2013 23:07:06 +0200 Subject: Support named destinations in remote link annotations. Previously there was a bug when parsing GoToR link annotations that had a named destination. mupdf incorrectly attempted to resolve the destination in the current document. Now the destination name is present in the link objects returned to the application so it can resolve any names for GoToR links in the remote document instead. --- include/mupdf/fitz/link.h | 10 +++++++++- include/mupdf/pdf/annot.h | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/mupdf/fitz/link.h b/include/mupdf/fitz/link.h index 65a77fd2..7a400851 100644 --- a/include/mupdf/fitz/link.h +++ b/include/mupdf/fitz/link.h @@ -47,7 +47,14 @@ enum { For FZ_LINK_GOTO or FZ_LINK_GOTOR: gotor.page: The target page number to move to (0 being the - first page in the document). + first page in the document). In the FZ_LINK_GOTOR case, the + page number either refers to to the file specified by + gotor.file_spec, or the page number is -1 suggesting that + the destination is given by gotor.dest. + + gotor.dest: If set, the target destination name to be + resolved in the file specified by gotor.file_spec. Always + NULL in the FZ_LINK_GOTO case. gotor.flags: A bitfield consisting of fz_link_flag_* describing the validity and meaning of the different parts @@ -97,6 +104,7 @@ struct fz_link_dest_s struct { int page; + char *dest; int flags; fz_point lt; fz_point rb; diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h index d6950970..bf912ef9 100644 --- a/include/mupdf/pdf/annot.h +++ b/include/mupdf/pdf/annot.h @@ -56,7 +56,7 @@ struct pdf_annot_s int widget_type; }; -fz_link_dest pdf_parse_link_dest(pdf_document *doc, pdf_obj *dest); +fz_link_dest pdf_parse_link_dest(pdf_document *doc, fz_link_kind kind, pdf_obj *dest); fz_link_dest pdf_parse_action(pdf_document *doc, pdf_obj *action); pdf_obj *pdf_lookup_dest(pdf_document *doc, pdf_obj *needle); pdf_obj *pdf_lookup_name(pdf_document *doc, char *which, pdf_obj *needle); -- cgit v1.2.3