summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/mupdf/fitz/link.h3
-rw-r--r--source/pdf/pdf-annot.c5
2 files changed, 5 insertions, 3 deletions
diff --git a/include/mupdf/fitz/link.h b/include/mupdf/fitz/link.h
index 7a400851..47648a4c 100644
--- a/include/mupdf/fitz/link.h
+++ b/include/mupdf/fitz/link.h
@@ -91,6 +91,8 @@ enum {
launch.new_window: If true, the destination should be launched
in a new window.
+ launch.is_uri: If true, launch.file_spec is a URI to launch.
+
For FZ_LINK_NAMED:
named.named: The named action to perform. Likely to be
@@ -122,6 +124,7 @@ struct fz_link_dest_s
{
char *file_spec;
int new_window;
+ int is_uri;
}
launch;
struct
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"))
{