summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2016-11-14 13:03:07 +0100
committerTor Andersson <tor.andersson@artifex.com>2016-11-14 13:23:57 +0100
commit2216f9402a9ddf232e15fdd508b9123011af8bd3 (patch)
tree3b4e44be0e332bb9d957864fcde41057ed0fcb79 /include
parent018253cfc8a34805c4fc1e0f955e3696db60886a (diff)
downloadmupdf-2216f9402a9ddf232e15fdd508b9123011af8bd3.tar.xz
Add/fix page coordinates to link targets.
Correctly transformed target coordinates for PDF. Target coordinates for EPUB and HTML.
Diffstat (limited to 'include')
-rw-r--r--include/mupdf/fitz/document.h6
-rw-r--r--include/mupdf/pdf/annot.h2
-rw-r--r--include/mupdf/pdf/page.h1
3 files changed, 6 insertions, 3 deletions
diff --git a/include/mupdf/fitz/document.h b/include/mupdf/fitz/document.h
index d8123a00..105692e6 100644
--- a/include/mupdf/fitz/document.h
+++ b/include/mupdf/fitz/document.h
@@ -32,7 +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_resolve_link_fn)(fz_context *ctx, fz_document *doc, const char *uri, float *xp, float *yp);
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);
@@ -214,9 +214,11 @@ int fz_count_pages(fz_context *ctx, fz_document *doc);
/*
fz_resolve_link: Resolve an internal link to a page number.
+ xp, yp: Pointer to store coordinate of destination on the page.
+
Returns -1 if the URI cannot be resolved.
*/
-int fz_resolve_link(fz_context *ctx, fz_document *doc, const char *uri);
+int fz_resolve_link(fz_context *ctx, fz_document *doc, const char *uri, float *xp, float *yp);
/*
fz_load_page: Load a page.
diff --git a/include/mupdf/pdf/annot.h b/include/mupdf/pdf/annot.h
index caaa9047..49ae9246 100644
--- a/include/mupdf/pdf/annot.h
+++ b/include/mupdf/pdf/annot.h
@@ -108,7 +108,7 @@ pdf_obj *pdf_lookup_dest(fz_context *ctx, pdf_document *doc, pdf_obj *needle);
pdf_obj *pdf_lookup_name(fz_context *ctx, pdf_document *doc, pdf_obj *which, pdf_obj *needle);
pdf_obj *pdf_load_name_tree(fz_context *ctx, pdf_document *doc, pdf_obj *which);
-int pdf_resolve_link(fz_context *ctx, pdf_document *doc, const char *uri);
+int pdf_resolve_link(fz_context *ctx, pdf_document *doc, const char *uri, float *xp, float *yp);
fz_link *pdf_load_link_annots(fz_context *ctx, pdf_document *, pdf_obj *annots, const fz_matrix *page_ctm);
void pdf_annot_transform(fz_context *ctx, pdf_annot *annot, fz_matrix *annot_ctm);
diff --git a/include/mupdf/pdf/page.h b/include/mupdf/pdf/page.h
index 407fcc09..bae9193f 100644
--- a/include/mupdf/pdf/page.h
+++ b/include/mupdf/pdf/page.h
@@ -34,6 +34,7 @@ void pdf_flatten_inheritable_page_items(fz_context *ctx, pdf_obj *page);
pdf_page *pdf_load_page(fz_context *ctx, pdf_document *doc, int number);
void pdf_drop_page(fz_context *ctx, pdf_page *page);
+void pdf_page_obj_transform(fz_context *ctx, pdf_obj *pageobj, fz_rect *page_mediabox, fz_matrix *page_ctm);
void pdf_page_transform(fz_context *ctx, pdf_page *page, fz_rect *mediabox, fz_matrix *ctm);
pdf_obj *pdf_page_resources(fz_context *ctx, pdf_page *page);
pdf_obj *pdf_page_contents(fz_context *ctx, pdf_page *page);