* m-letter stationary
@ 2005-02-22 19:02 Rob Ermers
2005-02-23 8:47 ` Hans Hagen
0 siblings, 1 reply; 6+ messages in thread
From: Rob Ermers @ 2005-02-22 19:02 UTC (permalink / raw)
Dear Contexers,
I have succeeded in creating letters on my pdf stationary-1. Beautiful.
Now I want to print the second and following pages on paper with on a
slightly different stationary (stationary-2), as is costumary.
Does anyone how to set this up?
(The example on the wiki is too complicated for me. I sticked to sample
files from Hans Hagen, which makes it possible to use an xml address
database.)
The present set up for the background is given below.
Kind regards,
Robert Ermers
\useexternalfigure[achtergrond][stationary-1.pdf][]
\definelayer[achtergrond]
\setupbackgrounds[page][state=repeat,background={achtergrond}]
\setlayer[achtergrond][x=0in,y=0in]{\externalfigure[stationary-1.pdf]}
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: m-letter stationary
2005-02-22 19:02 m-letter stationary Rob Ermers
@ 2005-02-23 8:47 ` Hans Hagen
2005-02-24 8:45 ` Rob Ermers
0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2005-02-23 8:47 UTC (permalink / raw)
Rob Ermers wrote:
> Dear Contexers,
>
> I have succeeded in creating letters on my pdf stationary-1. Beautiful.
>
> Now I want to print the second and following pages on paper with on a
> slightly different stationary (stationary-2), as is costumary.
>
> Does anyone how to set this up?
>
> (The example on the wiki is too complicated for me. I sticked to sample
> files from Hans Hagen, which makes it possible to use an xml address
> database.)
>
> The present set up for the background is given below.
>
> Kind regards,
>
> Robert Ermers
>
>
> \useexternalfigure[achtergrond][stationary-1.pdf][]
> \definelayer[achtergrond]
>
> \setupbackgrounds[page][state=repeat,background={achtergrond}]
>
> \setlayer[achtergrond][x=0in,y=0in]{\externalfigure[stationary-1.pdf]}
An option is to use the logo features but since layers are more fun i will
probably turn that into an optional module some day (is anyone using it?)
put this in cont-new.tex:
\unprotect
\unexpanded\def\flushlayer[#1]%
{\doifelsevalue{\??ll#1\c!state}\v!next
{\global\letvalue{\??ll#1\c!state}\v!start} % dangerous, stack-built-up
{\doifelsevalue{\??ll#1\c!state}\v!continue
{\global\letvalue{\??ll#1\c!state}\v!repeat} % dangerous, stack-built-up
{\doifelsevalue{\??ll#1\c!doublesided}\v!yes
{\doifundefinedelse{\@@layerbox#1}%
{\dodoflushlayerA[#1]}
{\doifbothsidesoverruled
\dodoflushlayerB\v!left [#1]% left
\orsideone
\dodoflushlayerB\v!right[#1]% right
\orsidetwo
\dodoflushlayerB\v!left [#1]% left
\od}}
{\dodoflushlayerA[#1]}}}}
\protect
Then you can say:
\definelayer[achtergrond-1][width=\paperwidth,height=\paperheight]
\definelayer[achtergrond-2][width=\paperwidth,height=\paperheight,state=continue]
\setupbackgrounds[page][background={achtergrond-1,achtergrond-2}]
\setlayer[achtergrond-1][preset=lefttop] {\externalfigure[stationary-1.pdf]}
\setlayer[achtergrond-2][preset=leftbottom]{\externalfigure[stationary-2.pdf]}
\starttext
test \page test \page
test \page test \page
\stoptext
(i added the 'continue' option)
Hans
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: m-letter stationary
2005-02-23 8:47 ` Hans Hagen
@ 2005-02-24 8:45 ` Rob Ermers
2005-02-24 11:39 ` h h extern
0 siblings, 1 reply; 6+ messages in thread
From: Rob Ermers @ 2005-02-24 8:45 UTC (permalink / raw)
Hans,
Thank you very much for your code. Both types of the stationary come out
smoothly. There is however a small bug in it.
I need a different stationary starting from every second page of my
letter. If my file contains 4 letters consisting of 8 pages, his means
the following:
letter 1 -- page 1 -- stationary-1.pdf
letter 1 -- page 2 -- stationary-2.pdf
letter 2 -- page 1 -- stationary-1.pdf
letter 2 -- page 2 -- stationary-2.pdf
...
The code, however, does the following:
letter 1 -- page 1 -- stationary-1.pdf
letter 1 -- page 2 -- stationary-2.pdf
letter 2 -- page 1 -- stationary-2.pdf
letter 2 -- page 2 -- stationary-2.pdf
...
That's to say, there is only one sheet with stationary-1, all other
pages are printed on stationary-2.
Do you see a possibility to adapt this?
Thanks in advance.
Kind regards,
Robert
> Rob Ermers wrote:
>
>> Dear Contexers,
>>
>> I have succeeded in creating letters on my pdf stationary-1. Beautiful.
>>
>> Now I want to print the second and following pages on paper with on a
>> slightly different stationary (stationary-2), as is costumary.
>>
>> Does anyone how to set this up?
>>
>> (The example on the wiki is too complicated for me. I sticked to
>> sample files from Hans Hagen, which makes it possible to use an xml
>> address database.)
>>
>> The present set up for the background is given below.
>>
>> Kind regards,
>>
>> Robert Ermers
>>
>>
>> \useexternalfigure[achtergrond][stationary-1.pdf][]
>> \definelayer[achtergrond]
>>
>> \setupbackgrounds[page][state=repeat,background={achtergrond}]
>>
>> \setlayer[achtergrond][x=0in,y=0in]{\externalfigure[stationary-1.pdf]}
>
>
> An option is to use the logo features but since layers are more fun i
> will probably turn that into an optional module some day (is anyone
> using it?)
>
> put this in cont-new.tex:
>
> \unprotect
> \unexpanded\def\flushlayer[#1]%
> {\doifelsevalue{\??ll#1\c!state}\v!next
> {\global\letvalue{\??ll#1\c!state}\v!start} % dangerous,
> stack-built-up
> {\doifelsevalue{\??ll#1\c!state}\v!continue
> {\global\letvalue{\??ll#1\c!state}\v!repeat} % dangerous,
> stack-built-up
> {\doifelsevalue{\??ll#1\c!doublesided}\v!yes
> {\doifundefinedelse{\@@layerbox#1}%
> {\dodoflushlayerA[#1]}
> {\doifbothsidesoverruled
> \dodoflushlayerB\v!left [#1]% left
> \orsideone
> \dodoflushlayerB\v!right[#1]% right
> \orsidetwo
> \dodoflushlayerB\v!left [#1]% left
> \od}}
> {\dodoflushlayerA[#1]}}}}
> \protect
>
> Then you can say:
>
> \definelayer[achtergrond-1][width=\paperwidth,height=\paperheight]
> \definelayer[achtergrond-2][width=\paperwidth,height=\paperheight,state=continue]
>
>
> \setupbackgrounds[page][background={achtergrond-1,achtergrond-2}]
>
> \setlayer[achtergrond-1][preset=lefttop]
> {\externalfigure[stationary-1.pdf]}
> \setlayer[achtergrond-2][preset=leftbottom]{\externalfigure[stationary-2.pdf]}
>
>
> \starttext
>
> test \page test \page
> test \page test \page
>
> \stoptext
>
> (i added the 'continue' option)
>
>
> Hans
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: m-letter stationary
2005-02-24 8:45 ` Rob Ermers
@ 2005-02-24 11:39 ` h h extern
2005-02-24 20:35 ` Rob Ermers
0 siblings, 1 reply; 6+ messages in thread
From: h h extern @ 2005-02-24 11:39 UTC (permalink / raw)
Rob Ermers wrote:
> Hans,
>
> Thank you very much for your code. Both types of the stationary come out
> smoothly. There is however a small bug in it.
>
> I need a different stationary starting from every second page of my
> letter. If my file contains 4 letters consisting of 8 pages, his means
> the following:
>
> letter 1 -- page 1 -- stationary-1.pdf
> letter 1 -- page 2 -- stationary-2.pdf
>
> letter 2 -- page 1 -- stationary-1.pdf
> letter 2 -- page 2 -- stationary-2.pdf
> ...
>
> The code, however, does the following:
> letter 1 -- page 1 -- stationary-1.pdf
> letter 1 -- page 2 -- stationary-2.pdf
>
> letter 2 -- page 1 -- stationary-2.pdf
> letter 2 -- page 2 -- stationary-2.pdf
> ...
>
> That's to say, there is only one sheet with stationary-1, all other
> pages are printed on stationary-2.
>
> Do you see a possibility to adapt this?
quick answer:
\setlayer[page][odd][...]{...}
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: m-letter stationary
2005-02-24 11:39 ` h h extern
@ 2005-02-24 20:35 ` Rob Ermers
2005-02-24 21:48 ` h h extern
0 siblings, 1 reply; 6+ messages in thread
From: Rob Ermers @ 2005-02-24 20:35 UTC (permalink / raw)
h h extern wrote:
> Rob Ermers wrote:
>
>> Hans,
>>
>> Thank you very much for your code. Both types of the stationary come
>> out smoothly. There is however a small bug in it.
>>
>> I need a different stationary starting from every second page of my
>> letter. If my file contains 4 letters consisting of 8 pages, his means
>> the following:
>>
>> letter 1 -- page 1 -- stationary-1.pdf
>> letter 1 -- page 2 -- stationary-2.pdf
>>
>> letter 2 -- page 1 -- stationary-1.pdf
>> letter 2 -- page 2 -- stationary-2.pdf
>> ...
>>
>> The code, however, does the following:
>> letter 1 -- page 1 -- stationary-1.pdf
>> letter 1 -- page 2 -- stationary-2.pdf
>>
>> letter 2 -- page 1 -- stationary-2.pdf
>> letter 2 -- page 2 -- stationary-2.pdf
>> ...
>>
>> That's to say, there is only one sheet with stationary-1, all other
>> pages are printed on stationary-2.
>>
>> Do you see a possibility to adapt this?
>
>
> quick answer:
>
> \setlayer[page][odd][...]{...}
Thanks Hans for your suggestion.
I'm sorry, I tried to apply the code in various ways, but I cannot get
it running. The variables are all gone now [page] has taken their place.
How do I have to apply this code?
Thanks again in advance.
Kind regards,
Robert
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: m-letter stationary
2005-02-24 20:35 ` Rob Ermers
@ 2005-02-24 21:48 ` h h extern
0 siblings, 0 replies; 6+ messages in thread
From: h h extern @ 2005-02-24 21:48 UTC (permalink / raw)
Rob Ermers wrote:
> I'm sorry, I tried to apply the code in various ways, but I cannot get
> it running. The variables are all gone now [page] has taken their place.
> How do I have to apply this code?
\definelayer[test][doublesided=yes,state=repeat]
\setupbackgrounds[page][background=test]
\setlayer[test][left] []{VERY ODD}
\setlayer[test][right][]{VERY EVEN}
\starttext
test \page test \page
test \page test \page
test \page test \page
\stoptext
-----------------------------------------------------------------
Hans Hagen | PRAGMA ADE
Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
| www.pragma-pod.nl
-----------------------------------------------------------------
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2005-02-24 21:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-02-22 19:02 m-letter stationary Rob Ermers
2005-02-23 8:47 ` Hans Hagen
2005-02-24 8:45 ` Rob Ermers
2005-02-24 11:39 ` h h extern
2005-02-24 20:35 ` Rob Ermers
2005-02-24 21:48 ` h h extern
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).