summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfmx/src/spc_pdfm.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipdfmx/src/spc_pdfm.c')
-rw-r--r--Build/source/texk/dvipdfmx/src/spc_pdfm.c26
1 files changed, 22 insertions, 4 deletions
diff --git a/Build/source/texk/dvipdfmx/src/spc_pdfm.c b/Build/source/texk/dvipdfmx/src/spc_pdfm.c
index 8681af2586b..67a66dba7c5 100644
--- a/Build/source/texk/dvipdfmx/src/spc_pdfm.c
+++ b/Build/source/texk/dvipdfmx/src/spc_pdfm.c
@@ -1,8 +1,8 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/spc_pdfm.c,v 1.24 2006/12/11 12:46:03 chofchof Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/spc_pdfm.c,v 1.26 2007/04/25 09:44:49 chofchof Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
- Copyright (C) 2002 by Jin-Hwan Cho and Shunsaku Hirata,
+ Copyright (C) 2007 by Jin-Hwan Cho and Shunsaku Hirata,
the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
Copyright (C) 1998, 1999 by Mark A. Wicks <mwicks@kettering.edu>
@@ -765,11 +765,29 @@ spc_handler_pdfm_outline (struct spc_env *spe, struct spc_arg *args)
{
struct spc_pdf_ *sd = &_pdf_stat;
pdf_obj *item_dict, *tmp;
- int level;
+ int level, is_open = -1;
int current_depth;
skip_white(&args->curptr, args->endptr);
+ /*
+ * pdf:outline is extended to support open/close feature
+ *
+ * pdf:outline 1 ... (as DVIPDFM)
+ * pdf:outline [] 1 ... (open bookmark)
+ * pdf:outline [-] 1 ... (closed bookmark)
+ */
+ if (args->curptr+3 < args->endptr && *args->curptr == '[') {
+ args->curptr++;
+ if (*args->curptr == '-') {
+ args->curptr++;
+ } else {
+ is_open = 1;
+ }
+ args->curptr++;
+ }
+ skip_white(&args->curptr, args->endptr);
+
tmp = parse_pdf_object(&args->curptr, args->endptr);
if (!tmp) {
spc_warn(spe, "Missing number for outline item depth.");
@@ -815,7 +833,7 @@ spc_handler_pdfm_outline (struct spc_env *spe, struct spc_arg *args)
pdf_doc_bookmarks_down();
}
- pdf_doc_bookmarks_add(item_dict, -1); /* Use global setting for open/close */
+ pdf_doc_bookmarks_add(item_dict, is_open);
return 0;
}