Fwd: Personalizing a PDF generated with ConTeXt
Should have gone to the list instead of to Taco.
---------- Forwarded message ----------
From: Cecil Westerhof
\setvariables and \getvariables sounds like the most general solution
in that case.
For example, you could put the various \setvariables statements in various separate files and load a specific one from the context command line with --environment=...
I tried it and it works. Only one thing: when the variables are not set (forgot the environment parameter, file not correctly set, ...) I would like to set default values. How would I do that? -- Cecil Westerhof -- Cecil Westerhof
2011/3/5 Cecil Westerhof
For example, you could put the various \setvariables statements in various
separate files and load a specific one from the context command line with --environment=...
I tried it and it works. Only one thing: when the variables are not set (forgot the environment parameter, file not correctly set, ...) I would like to set default values. How would I do that?
For who likes to something along the same lines: I attached a BASH script
that generates all the PDF's based on .per files. You call the script with:
compileContextPersonalised.sh
Am 05.03.2011 um 12:25 schrieb Cecil Westerhof:
2011/3/1 Taco Hoekwater
\setvariables and \getvariables sounds like the most general solution in that case.
For example, you could put the various \setvariables statements in various separate files and load a specific one from the context command line with --environment=...
I tried it and it works. Only one thing: when the variables are not set (forgot the environment parameter, file not correctly set, ...) I would like to set default values. How would I do that?
%\enablemode[variables] \startmode[variables] \setvariables [test] [one=One, two=Two] \stopmode \starttext \doifelsevariable{test}{one}{1: \getvariable{test}{one}}{??}\par \doifelsevariable{test}{two}{2: \getvariable{test}{two}}{??} \stoptext Wolfgang
2011/3/5 Wolfgang Schuster
\setvariables and \getvariables sounds like the most general solution
in that case.
For example, you could put the various \setvariables statements in various separate files and load a specific one from the context command line with --environment=...
I tried it and it works. Only one thing: when the variables are not set (forgot the environment parameter, file not correctly set, ...) I would like to set default values. How would I do that?
%\enablemode[variables]
\startmode[variables] \setvariables [test] [one=One, two=Two] \stopmode
\starttext \doifelsevariable{test}{one}{1: \getvariable{test}{one}}{??}\par \doifelsevariable{test}{two}{2: \getvariable{test}{two}}{??} \stoptext
Works. I use: \doifelsevariable{personalise}{completeName}{}{ \setvariables[personalise][ completeName=Cecil Westerhof, . . . ] } -- Cecil Westerhof
participants (2)
-
Cecil Westerhof
-
Wolfgang Schuster