1%
2% a2ps styled header.
3% Copyright (c) 1996-1999 Markku Rossi.
4% Author: Markku Rossi <mtr@iki.fi>
5%
6
7%
8% This file is part of GNU Enscript.
9%
10% Enscript is free software: you can redistribute it and/or modify
11% it under the terms of the GNU General Public License as published by
12% the Free Software Foundation, either version 3 of the License, or
13% (at your option) any later version.
14%
15% Enscript is distributed in the hope that it will be useful,
16% but WITHOUT ANY WARRANTY; without even the implied warranty of
17% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18% GNU General Public License for more details.
19%
20% You should have received a copy of the GNU General Public License
21% along with Enscript.  If not, see <http://www.gnu.org/licenses/>.
22%
23
24% -- code follows this line --
25%Format: userstr	Printed by %N
26%Format: datestr	%D{%d %b %Y %H:%M}
27%Format: fmodstr	$D{%d %b %Y %H:%M}
28%Format: upperpagestr	Page $V$%/$=
29%Format: lowerpagestr	page $p
30
31%HeaderHeight: 36
32%FooterHeight: 12
33
34% Fonts.
35/Helvetica /helvetica-encoded MF
36/SmallFont /helvetica-encoded findfont 10 scalefont def
37
38/Helvetica-Bold /helvetica-bold-encoded MF
39/BigFont   /helvetica-bold-encoded findfont 12 scalefont def
40
41/a2ps_marg 10 def
42
43/do_header {	% print a2ps header
44  gsave
45    % lowerpagestr
46    SmallFont setfont
47    d_footer_x d_footer_w add lowerpagestr stringwidth pop sub
48    a2ps_marg sub
49    d_footer_y moveto lowerpagestr show
50
51    % current date in footer
52    SmallFont setfont
53    d_footer_x a2ps_marg add d_footer_y moveto datestr show
54
55    % full filename in footer
56    SmallFont setfont
57    d_footer_x d_footer_w 2 div add fname stringwidth pop 2 div sub
58    d_footer_y moveto fname show
59
60    % gray box to header
61    .95 setgray
62    d_header_x d_header_y d_header_w 24 Box fill
63    0 setgray
64
65    % borders.
66    .5 setlinewidth
67    d_header_x d_header_y d_header_w 24 Box stroke
68
69    % userstr
70    d_header_x d_header_w add userstr stringwidth pop sub a2ps_marg sub
71    d_header_y 29 add moveto userstr show
72
73    % datestr
74    d_header_x a2ps_marg add d_header_y 6 add moveto fmodstr show
75
76    % upperpagestr
77    d_header_x d_header_w add upperpagestr stringwidth pop sub
78    a2ps_marg sub
79    d_header_y 6 add moveto upperpagestr show
80
81    % filename
82    BigFont setfont
83    d_header_x d_header_w 2 div add ftail stringwidth pop 2 div sub
84    d_header_y 6 add moveto ftail show
85  grestore
86} def
87