summaryrefslogtreecommitdiff
path: root/tex/context/base/mkiv/mtx-context-trim.tex
diff options
context:
space:
mode:
authorContext Git Mirror Bot <phg42.2a@gmail.com>2016-03-12 17:15:10 +0100
committerContext Git Mirror Bot <phg42.2a@gmail.com>2016-03-12 17:15:10 +0100
commit4b6314243d4bc44fa3c94f569264fdffd5405e90 (patch)
treea50e4f3309d40b2709618a00311934c55258cfbc /tex/context/base/mkiv/mtx-context-trim.tex
parent4a28e5cee346738f2f9be479090c3657a87b7206 (diff)
downloadcontext-4b6314243d4bc44fa3c94f569264fdffd5405e90.tar.gz
2016-03-12 16:45:00
Diffstat (limited to 'tex/context/base/mkiv/mtx-context-trim.tex')
-rw-r--r--tex/context/base/mkiv/mtx-context-trim.tex72
1 files changed, 72 insertions, 0 deletions
diff --git a/tex/context/base/mkiv/mtx-context-trim.tex b/tex/context/base/mkiv/mtx-context-trim.tex
new file mode 100644
index 000000000..46d0c3188
--- /dev/null
+++ b/tex/context/base/mkiv/mtx-context-trim.tex
@@ -0,0 +1,72 @@
+%D \module
+%D [ file=mtx-context-trim,
+%D version=2016.03.04,
+%D title=\CONTEXT\ Extra Trickry,
+%D subtitle=Trimming Files,
+%D author=Hans Hagen,
+%D date=\currentdate,
+%D copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
+%C
+%C This module is part of the \CONTEXT\ macro||package and is
+%C therefore copyrighted by \PRAGMA. See mreadme.pdf for
+%C details.
+
+%D This is a very old module based feature that has been moved to \MKIV.
+
+% begin help
+%
+% usage: context --extra=trim [options] filename
+%
+% --paperwidth : target paperwidth
+% --paperheight : target paperheight
+% --file : processed file
+% --x : page x offset
+% --y : page y offset
+% --hoffset : horizontal clip offset
+% --voffset : vertical clip offset
+% --width : clip width
+% --height : clip height
+%
+% example: context --extra=trim --file=trimtest --hoffset=3.50cm --voffset=3.50cm --width=15cm --height=21cm
+%
+% end help
+
+\input mtx-context-common.tex
+
+\setdocumentargumentdefault {paperwidth} {21cm}
+\setdocumentargumentdefault {paperheight} {29.7cm}
+\setdocumentargumentdefault {file} {\getdocumentfilename{1}}
+\setdocumentargumentdefault {hoffset} {0cm}
+\setdocumentargumentdefault {voffset} {0cm}
+\setdocumentargumentdefault {width} {17cm}
+\setdocumentargumentdefault {height} {24cm}
+\setdocumentargumentdefault {x} {0cm}
+\setdocumentargumentdefault {y} {0cm}
+
+\doifnothing{\getdocumentargument{file}} {\starttext missing filename \stoptext}
+\doif {\getdocumentargument{file}}{\inputfilename.tex}{\starttext missing filename \stoptext}
+
+\definepapersize
+ [fuzzy]
+ [width=\getdocumentargument{paperwidth},
+ height=\getdocumentargument{paperheight}]
+
+\setuppapersize
+ [fuzzy]
+ [fuzzy]
+
+\setuplayout
+ [page]
+
+\starttext
+
+ \trimpages
+ [file=\getdocumentargument{file},
+ hoffset=\getdocumentargument{hoffset},
+ voffset=\getdocumentargument{voffset},
+ width=\getdocumentargument{width},
+ height=\getdocumentargument{height},
+ x=\getdocumentargument{x},
+ y=\getdocumentargument{y}]
+
+\stoptext