/usr/share/doc/mgetty/examples/coverpg.ps is in mgetty-docs 1.1.36-3.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 | #!/bin/sh
#
# make.coverpg -- slightly advanced version, use ghostscript
# (just a sample, naturally you have to adapt all the texts!)
#
# Author: gert@greenie.muc.de
#
# Syntax:
# make.coverpg <pages> <sender-ID> <sender-NAME> <receiver-ID>
# <receiver-NAME> <date> <time>
#
# if called with "-m <memo-file>", put that file on cover page:
MEMO=""
if [ X$1 = X-m ] ; then
MEMO=$2
shift ; shift
fi
#
# get arguments
#
PAGES=$1
S_ID="$2"
S_NAME="$3"
R_ID="$4"
R_NAME="$5"
DATE="$6"
TIME="$7"
tmp=/tmp/cover.$$.ps
#
# chose proper driver for resolution
driver=dfaxhigh ; test X$normal_res != X && driver=dfaxlow
cat << EOF >$tmp
%! PS-Adobe-1.0
%%Title: Sendfax Fax Header Page
%
% simple logo, "top right" corner is at x/y=570/750
%
1 5 100
{
dup 100 div setgray
dup 10 div 1 add setlinewidth
dup 5 mul 570 exch sub % x = 10*i + 50
750 moveto % y = 100
dup 5 mul 750 exch sub
570 exch lineto % x, y as above but swapped
pop
stroke
} for
%
% change encoding to ISO8859-1 (important for my German umlauts) [Fritz Elfert]
%
/ISOfindfont {
dup 100 string cvs (ISO-) exch concatstrings cvn exch
findfont dup maxlength dict begin
{ 1 index /FID ne {def}{pop pop} ifelse } forall
/Encoding ISOLatin1Encoding def
currentdict
end definefont
} def
%
% page title
%
/Times-BoldItalic findfont 37 scalefont setfont
0 setgray
100 600 moveto
(TELEFAX - NACHRICHT) dup
gsave true charpath 1 setgray 1 setlinewidth stroke grestore
show
EOF
# now the page layout differs, depending on the use of "MEMO" or not
if [ -z "$MEMO" ] ; then
cat <<EOF >>$tmp
%
% data
%
/Times-Roman ISOfindfont 19 scalefont setfont
100 500 moveto (Absender: ) show
currentpoint ($S_ID) show
-20 add moveto ($S_NAME) show
100 420 moveto (Empfänger: ) show
currentpoint ($R_ID) show
-20 add moveto ($R_NAME) show
100 340 moveto (Sendezeit: $TIME $DATE) show
100 280 moveto (Seiten \(inkl. Deckblatt\): $PAGES) show
%
% blatant advertising...
%
/Courier ISOfindfont 9 scalefont setfont
100 100 moveto
(Fax software used: mgetty+sendfax 1.1.x on SCO Unix, (c) 1994-97 Gert Döring)
show
showpage
EOF
# end "no memo"
else
# start "with memo"
cat <<EOF >>$tmp
%
% data (squeezed somewhat)
%
/Times-Roman ISOfindfont 19 scalefont setfont
100 550 moveto (Absender: ) show
currentpoint ($S_ID) show
-20 add moveto ($S_NAME) show
100 500 moveto (Empfänger: ) show
currentpoint ($R_ID) show
-20 add moveto ($R_NAME) show
100 450 moveto (Sendezeit: $TIME $DATE) show
100 420 moveto (Seiten \(inkl. Deckblatt\): $PAGES) show
50 380 moveto (Kurznachricht:) show
%
% blatant advertising...
%
/Courier ISOfindfont 9 scalefont setfont
100 50 moveto
(Fax software used: mgetty+sendfax 1.1.x on SCO Unix, (c) 1994 Gert Döring)
show
/Courier-BoldOblique ISOfindfont 14 scalefont setfont
EOF
# now put text from file "MEMO" on page (mini "a2ps")
sed -e "s/(/\\\(/g" -e "s/)/\\\)/g" $MEMO | \
awk 'BEGIN { x=50; y=350 }
END { printf "showpage\n" }
{ printf "%d %d moveto (%s) show\n", x, y, $0 ;
y -= 15; }' - >>$tmp
# end "with memo"
fi
cat $tmp | gs -sDEVICE=$driver -sOutputFile=- -dSAFER -dNOPAUSE -q -
rm -f $tmp
|