[pdftex] Adding objects to the page
Heiko Oberdiek
oberdiek at uni-freiburg.de
Tue Jan 26 18:12:18 CET 2010
Hello,
On Tue, Jan 26, 2010 at 03:56:42PM +0100, Patrick Gundlach wrote:
> > Package `atbegshi'. With \AtBeginShipoutUpperLeft and
> > \AtBeginShipoutUpperLeftForeground you can put things in the
> > background or foreground of the output box inside \AtBeginShipout.
>
> Gee! I need to get TeXbrain 2.0 before I understand what is going on there. If
> I come across a similar problem, I will try out 'atbegshi'.
>
> If someone (the archive) wants to know what I am doing now... (some off topic LuaTeX code following)
>
> I have taken this from plain.tex:
>
> \def\plainoutput{\shipout\vbox{\dothingsbeforeoutput\pagebody\makefootline}%
> \advancepageno
> \ifnum\outputpenalty>-20000 \else\dosupereject\fi}
>
> (Just added \dothingsbeforeoutput)
>
> this is \dothingsbeforeoutput:
>
> \def\dothingsbeforeoutput{
> \directlua{dothingsbeforeoutput()}
> }
>
> and there I collect \pdfliteral page {......} TeX-strings and write back
> to TeX via 'tex.sprint("\\pdfliteral page {.....}")'. This way I make
> sure these pdfilterals come before the page contents. That was a very
> easy hack. I hope it has no side effects.
\input atbegshi.sty
\AtBeginShipout{%
\setbox\AtBeginShipoutBox=\hbox{%
\pdfliteral ...
\copy\AtBeginShipoutBox
}%
}
Yours sincerely
Heiko <oberdiek at uni-freiburg.de>
--
More information about the pdftex
mailing list