summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/spc_pdfm.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-08-26 23:28:58 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2018-08-26 23:28:58 +0000
commit3db2581dfeef53ee35167ecdd6d80ce07238434f (patch)
tree15ec36daf4c923b67481944d5412cc0c57d14b85 /Build/source/texk/dvipdfm-x/spc_pdfm.c
parent5c4fcece888ee328ff7d9a04ca94e053bc279749 (diff)
Additional dictionary keys can be specified for tounicode conversion (S. Hirata).
git-svn-id: svn://tug.org/texlive/trunk@48493 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/spc_pdfm.c')
-rw-r--r--Build/source/texk/dvipdfm-x/spc_pdfm.c26
1 files changed, 24 insertions, 2 deletions
diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c
index f67b1e600f7..66501a16634 100644
--- a/Build/source/texk/dvipdfm-x/spc_pdfm.c
+++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c
@@ -1484,8 +1484,7 @@ spc_handler_pdfm_stream_with_type (struct spc_env *spe, struct spc_arg *args, in
break;
case STRING_STREAM:
fstream = pdf_new_stream(STREAM_COMPRESS);
- if (instring)
- pdf_add_stream(fstream, instring, strlen(instring));
+ pdf_add_stream(fstream, pdf_string_value(tmp), pdf_string_length(tmp));
break;
default:
pdf_release_obj(tmp);
@@ -1864,6 +1863,7 @@ spc_handler_pdfm_tounicode (struct spc_env *spe, struct spc_arg *args)
{
struct spc_pdf_ *sd = &_pdf_stat;
char *cmap_name;
+ pdf_obj *taint_keys;
/* First clear */
sd->cd.cmap_id = -1;
@@ -1904,6 +1904,28 @@ spc_handler_pdfm_tounicode (struct spc_env *spe, struct spc_arg *args)
sd->cd.unescape_backslash = 1;
}
RELEASE(cmap_name);
+
+ /* Additional "taint key" */
+ taint_keys = parse_pdf_object(&args->curptr, args->endptr, NULL);
+ if (taint_keys) {
+ if (PDF_OBJ_ARRAYTYPE(taint_keys)) {
+ int i;
+ for (i = 0; i < pdf_array_length(taint_keys); i++) {
+ pdf_obj *key;
+
+ key = pdf_get_array(taint_keys, i);
+ if (PDF_OBJ_NAMETYPE(key))
+ pdf_add_array(sd->cd.taintkeys, pdf_link_obj(key));
+ else {
+ spc_warn(spe, "Invalid argument specified in pdf:tounicode special.");
+ }
+ }
+ } else {
+ spc_warn(spe, "Invalid argument specified in pdf:unicode special.");
+ }
+ pdf_release_obj(taint_keys);
+ }
+
return 0;
}