diff options
author | Robin Watts <robin.watts@artifex.com> | 2012-02-01 15:06:55 +0000 |
---|---|---|
committer | Robin Watts <robin@ghostscript.com> | 2012-02-02 00:16:48 +0000 |
commit | 4ab5924753d32b5eaeb80138c6626057f61b516f (patch) | |
tree | d60def29f688c36ca474c5b06221d58ee82268db /xps/xps_glyphs.c | |
parent | 16c575d5b9fb0ce4488cac07d2b09ccbcaaf95c9 (diff) | |
download | mupdf-4ab5924753d32b5eaeb80138c6626057f61b516f.tar.xz |
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.
Diffstat (limited to 'xps/xps_glyphs.c')
-rw-r--r-- | xps/xps_glyphs.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/xps/xps_glyphs.c b/xps/xps_glyphs.c index bbc49af1..0cc4af5d 100644 --- a/xps/xps_glyphs.c +++ b/xps/xps_glyphs.c @@ -387,6 +387,7 @@ xps_parse_glyphs(xps_document *doc, fz_matrix ctm, char *clip_att; char *opacity_att; char *opacity_mask_att; + char *navigate_uri_att; xml_element *transform_tag = NULL; xml_element *clip_tag = NULL; @@ -428,6 +429,7 @@ xps_parse_glyphs(xps_document *doc, fz_matrix ctm, clip_att = xml_att(root, "Clip"); opacity_att = xml_att(root, "Opacity"); opacity_mask_att = xml_att(root, "OpacityMask"); + navigate_uri_att = xml_att(root, "FixedPage.NavigateUri"); for (node = xml_down(root); node; node = xml_next(node)) { @@ -545,6 +547,9 @@ xps_parse_glyphs(xps_document *doc, fz_matrix ctm, area = fz_bound_text(doc->ctx, text, ctm); + if (navigate_uri_att) + xps_add_link(doc, area, base_uri, navigate_uri_att); + xps_begin_opacity(doc, ctm, area, opacity_mask_uri, dict, opacity_att, opacity_mask_tag); /* If it's a solid color brush fill/stroke do a simple fill */ |