summaryrefslogtreecommitdiff
path: root/source/pdf
diff options
context:
space:
mode:
authorSimon Bünzli <zeniko@gmail.com>2013-09-25 17:54:43 +0200
committerRobin Watts <robin.watts@artifex.com>2013-09-27 17:09:47 +0100
commit5c1263c852f1357f1519007ea9d06449b1071ec3 (patch)
tree020a397926fb5431e15966615a950bccdaa8a44f /source/pdf
parentab567929dbbb62237e4598f9c1b6a8231431305c (diff)
downloadmupdf-5c1263c852f1357f1519007ea9d06449b1071ec3.tar.xz
tweak pdf_parse_action
* Destination names are a name and not a string * Expose whether a /Launch action points to a path or a URI
Diffstat (limited to 'source/pdf')
-rw-r--r--source/pdf/pdf-annot.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/source/pdf/pdf-annot.c b/source/pdf/pdf-annot.c
index 4e3d1ca1..21cc00cc 100644
--- a/source/pdf/pdf-annot.c
+++ b/source/pdf/pdf-annot.c
@@ -264,8 +264,6 @@ pdf_parse_action(pdf_document *doc, pdf_obj *action)
ld.kind = FZ_LINK_URI;
ld.ld.uri.is_map = pdf_to_bool(pdf_dict_gets(action, "IsMap"));
ld.ld.uri.uri = pdf_to_utf8(doc, pdf_dict_gets(action, "URI"));
- ld.ld.gotor.file_spec = NULL;
- ld.ld.gotor.new_window = 0;
}
else if (!strcmp(pdf_to_name(obj), "Launch"))
{
@@ -273,11 +271,12 @@ pdf_parse_action(pdf_document *doc, pdf_obj *action)
file_spec = pdf_dict_gets(action, "F");
ld.ld.launch.file_spec = pdf_parse_file_spec(doc, file_spec);
ld.ld.launch.new_window = pdf_to_int(pdf_dict_gets(action, "NewWindow"));
+ ld.ld.launch.is_uri = !strcmp(pdf_to_name(pdf_dict_gets(file_spec, "FS")), "URL");
}
else if (!strcmp(pdf_to_name(obj), "Named"))
{
ld.kind = FZ_LINK_NAMED;
- ld.ld.named.named = pdf_to_utf8(doc, pdf_dict_gets(action, "N"));
+ ld.ld.named.named = fz_strdup(ctx, pdf_to_name(pdf_dict_gets(action, "N")));
}
else if (!strcmp(pdf_to_name(obj), "GoToR"))
{