From 8a07b7fb14f11204a0d840792ab9f4bd54b066e5 Mon Sep 17 00:00:00 2001 From: Tor Andersson Date: Mon, 17 Oct 2016 17:13:32 +0200 Subject: 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. --- source/fitz/document.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/fitz/document.c') diff --git a/source/fitz/document.c b/source/fitz/document.c index 43fcb133..87ad3884 100644 --- a/source/fitz/document.c +++ b/source/fitz/document.c @@ -215,6 +215,15 @@ fz_load_outline(fz_context *ctx, fz_document *doc) return NULL; } +int +fz_resolve_link(fz_context *ctx, fz_document *doc, const char *uri) +{ + fz_ensure_layout(ctx, doc); + if (doc && doc->resolve_link) + return doc->resolve_link(ctx, doc, uri); + return -1; +} + void fz_layout_document(fz_context *ctx, fz_document *doc, float w, float h, float em) { -- cgit v1.2.3