From 4ab5924753d32b5eaeb80138c6626057f61b516f Mon Sep 17 00:00:00 2001 From: Robin Watts Date: Wed, 1 Feb 2012 15:06:55 +0000 Subject: Work on supporting links in xps documents. Currently, this only works with local links. When running the page, check for NavigateUri entries; if found, and that page is not already marked as having resolved it's links, add a new link entry to doc->current_page links. When the page finishes running, mark the page as having resolved it's links. This avoids the links being generated multiple times. Update the mupdf viewer to use these links - but only AFTER the page has been run. --- apps/pdfapp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'apps') diff --git a/apps/pdfapp.c b/apps/pdfapp.c index 48e9fe93..aa529220 100644 --- a/apps/pdfapp.c +++ b/apps/pdfapp.c @@ -367,7 +367,6 @@ static void pdfapp_loadpage_xps(pdfapp_t *app) } app->page_bbox = xps_bound_page(app->xps, page); - app->page_links = NULL; /* Create display list */ app->page_list = fz_new_display_list(app->ctx); @@ -375,6 +374,8 @@ static void pdfapp_loadpage_xps(pdfapp_t *app) xps_run_page(app->xps, page, mdev, fz_identity, NULL); fz_free_device(mdev); + app->page_links = page->links; + xps_free_page(app->xps, page); } -- cgit v1.2.3