summaryrefslogtreecommitdiff
path: root/include/mupdf/fitz/document.h
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-10-17 17:13:32 +0200
committerTor Andersson <tor.andersson@artifex.com>2016-10-28 16:18:38 +0200
commit8a07b7fb14f11204a0d840792ab9f4bd54b066e5 (patch)
treee617a898c17aeb353f35d7b362ca2de290cf2b82 /include/mupdf/fitz/document.h
parent4029b45e494634361a4205f8896ec429d11e990a (diff)
downloadmupdf-8a07b7fb14f11204a0d840792ab9f4bd54b066e5.tar.xz
Clean up link destination handling.
All link destinations should be URIs, and a document specific function can be called to resolve them to actual page numbers. Outlines have cached page numbers as well as string URIs.
Diffstat (limited to 'include/mupdf/fitz/document.h')
-rw-r--r--include/mupdf/fitz/document.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/mupdf/fitz/document.h b/include/mupdf/fitz/document.h
index 7f3c8ece..d8123a00 100644
--- a/include/mupdf/fitz/document.h
+++ b/include/mupdf/fitz/document.h
@@ -32,6 +32,7 @@ typedef int (fz_document_authenticate_password_fn)(fz_context *ctx, fz_document
typedef int (fz_document_has_permission_fn)(fz_context *ctx, fz_document *doc, fz_permission permission);
typedef fz_outline *(fz_document_load_outline_fn)(fz_context *ctx, fz_document *doc);
typedef void (fz_document_layout_fn)(fz_context *ctx, fz_document *doc, float w, float h, float em);
+typedef int (fz_document_resolve_link_fn)(fz_context *ctx, fz_document *doc, const char *uri);
typedef int (fz_document_count_pages_fn)(fz_context *ctx, fz_document *doc);
typedef fz_page *(fz_document_load_page_fn)(fz_context *ctx, fz_document *doc, int number);
typedef int (fz_document_lookup_metadata_fn)(fz_context *ctx, fz_document *doc, const char *key, char *buf, int size);
@@ -87,6 +88,7 @@ struct fz_document_s
fz_document_has_permission_fn *has_permission;
fz_document_load_outline_fn *load_outline;
fz_document_layout_fn *layout;
+ fz_document_resolve_link_fn *resolve_link;
fz_document_count_pages_fn *count_pages;
fz_document_load_page_fn *load_page;
fz_document_lookup_metadata_fn *lookup_metadata;
@@ -210,6 +212,13 @@ void fz_layout_document(fz_context *ctx, fz_document *doc, float w, float h, flo
int fz_count_pages(fz_context *ctx, fz_document *doc);
/*
+ fz_resolve_link: Resolve an internal link to a page number.
+
+ Returns -1 if the URI cannot be resolved.
+*/
+int fz_resolve_link(fz_context *ctx, fz_document *doc, const char *uri);
+
+/*
fz_load_page: Load a page.
After fz_load_page is it possible to retrieve the size of the