summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/spc_util.c
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-07-21 05:10:23 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-07-21 05:10:23 +0000
commit0b17c5165b50b8184cb459e11ed9298819cb42e0 (patch)
tree11c794e44bf0b63c1339c73eb1cb492cb5d3b9fe /Build/source/texk/dvipdfm-x/spc_util.c
parentfb8abbdf8dd3ace56dd0c0d49b8c7cc09cfe27c5 (diff)
dvipdfm-x: Support pagebox=artbox etc. in PDF inclusion. It works with a new dvipdfmx.def.
git-svn-id: svn://tug.org/texlive/trunk@37918 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/spc_util.c')
-rw-r--r--Build/source/texk/dvipdfm-x/spc_util.c40
1 files changed, 28 insertions, 12 deletions
diff --git a/Build/source/texk/dvipdfm-x/spc_util.c b/Build/source/texk/dvipdfm-x/spc_util.c
index 869c9486358..56325e17cc9 100644
--- a/Build/source/texk/dvipdfm-x/spc_util.c
+++ b/Build/source/texk/dvipdfm-x/spc_util.c
@@ -533,6 +533,8 @@ spc_read_dimtrns_pdfm (struct spc_env *spe, transform_info *p, struct spc_arg *a
"page",
#define K__HIDE 11
"hide",
+#define K__PAGEBOX 12
+ "pagebox",
NULL
};
double xscale, yscale, rotate;
@@ -638,25 +640,40 @@ spc_read_dimtrns_pdfm (struct spc_env *spe, transform_info *p, struct spc_arg *a
if (!vp)
error = -1;
else {
- if (atof(vp))
- p->flags |= INFO_DO_CLIP;
- else
- p->flags &= ~INFO_DO_CLIP;
- RELEASE(vp);
+ if (atof(vp))
+ p->flags |= INFO_DO_CLIP;
+ else
+ p->flags &= ~INFO_DO_CLIP;
+ RELEASE(vp);
}
break;
case K__PAGE:
{
- double page;
- if (page_no && spc_util_read_numbers(&page, 1, ap) == 1)
- *page_no = (long) page;
- else
- error = -1;
+ double page;
+ if (page_no && spc_util_read_numbers(&page, 1, ap) == 1)
+ *page_no = (long) page;
+ else
+ error = -1;
}
break;
case K__HIDE:
p->flags |= INFO_DO_HIDE;
break;
+ case K__PAGEBOX:
+ {
+ char *q;
+ q = parse_c_ident (&ap->curptr, ap->endptr);
+ if (q) {
+ if (strcasecmp(q, "cropbox") == 0) PageBox = 1;
+ else if (strcasecmp(q, "mediabox") == 0) PageBox = 2;
+ else if (strcasecmp(q, "artbox") == 0) PageBox = 3;
+ else if (strcasecmp(q, "trimbox") == 0) PageBox = 4;
+ else if (strcasecmp(q, "bleedbox") == 0) PageBox = 5;
+ } else {
+ PageBox = 1;
+ }
+ }
+ break;
default:
error = -1;
break;
@@ -682,7 +699,7 @@ spc_read_dimtrns_pdfm (struct spc_env *spe, transform_info *p, struct spc_arg *a
spc_warn(spe, "Can't supply overall scale along with axis scales.");
error = -1;
} else if (has_matrix &&
- (has_scale || has_xscale || has_yscale || has_rotate)) {
+ (has_scale || has_xscale || has_yscale || has_rotate)) {
spc_warn(spe, "Can't supply transform matrix along with scales or rotate. Ignore scales and rotate.");
}
}
@@ -816,4 +833,3 @@ pdf_color_namedcolor (pdf_color *color, const char *name)
}
return -1;
}
-