aboutsummaryrefslogtreecommitdiffstats
path: root/print.ps
blob: fa77a49bbb817bc18bf3b408362de7a4faf0bd6a (plain)
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
%!
%
% Code between start/end remarks is put into ps.c
% Anything else is thrown away, and is for testing only.
%
% ---- ethereal preamble start ---- %
%!
%!PS-Adobe-2.0
%
% Ethereal - Network traffic analyzer
% By Gerald Combs <gerald@ethereal.com>
% Copyright 1998 Gerald Combs
%
%%Creator: Ethereal
%%Title: ethereal.ps
%%DocumentFonts: Helvetica Courier
%%EndComments
%!

% Get the Imagable Area of the page
clippath pathbbox

% Set vmax to the vertical size of the page,
% hmax to the horizontal size of the page.
/vmax exch def
/hmax exch def
pop pop		% junk

% 1-inch margins
/lmargin 72 def
/tmargin vmax 72 sub def
/bmargin 72 def
/pagenumtab hmax 72 sub def

% Counters
/vpos vmax 40 sub def
/thispagenum 1 def

% Strings
/pagenostr 7 string def

% Prints text with possible indenting
/putline {
	exch 10 mul lmargin add		% X
	vpos 						% Y
	moveto
	show

	/vpos vpos 10 sub def

	vpos bmargin le 			% is vpos <= bottom margin?
	{
		printpagenum showpage
		/vpos tmargin def
	}
	if							% then formfeed and start at top
} def

% A put line with smaller spacing and no formfeed
/titleline {
	lmargin						% X
	vpos						% Y
	moveto
	show

	/vpos vpos 8 sub def
} def

% Prints the page number at the top right
/printpagenum {
	gsave
		% Set the font to 8 point
		/Helvetica findfont 8 scalefont setfont

		pagenumtab					% X
		vmax 40 sub					% Y
		moveto
		(Page ) show
		thispagenum pagenostr cvs show

		% thispagenum++
		/thispagenum thispagenum 1 add def
	grestore
} def
	
% Set the font to 8 point
/Helvetica findfont 8 scalefont setfont

% Create the title
(Ethereal) titleline

% Reset the vertical position
/vpos tmargin def

% Set the font to 10 point
/Courier findfont 10 scalefont setfont
% ---- ethereal preamble end ---- %

% Display our output lines.
0 (Ethernet II \(98 on wire, 68 captured\)) putline
1 (Destination: 00:00:0c:36:00:2a) putline
1 (Source: 00:c0:4f:c7:eb:c0) putline
1 (Type: IP \(0x0800\)) putline
0 (Ethernet II \(98 on wire, 68 captured\)) putline
1 (Source: 00:c0:4f:c7:eb:c0) putline
1 (Type: IP \(0x0800\)) putline
0 (Source: 00:c0:4f:c7:eb:c0) putline

0 () putline
0 (0000  cc 00 00 00 00 00 07 02 00 00 00 00 00 00 00 00   ................ ) putline
0 (0010  00 00 bd 0e fe 16 01 00 3e 00 03 08 58 4c 20 38   ........>...XL 8 ) putline
0 (0020  30 20 49 4d 33 00 16 01 00 34 00 16 01 01 35 00   0 IM3....4....5. ) putline
0 (0030  16 01 02 36 00 16 01 03 6e 00 16 01 ff 6f 00 16   ...6....n....o.. ) putline
0 (0040  01 ff 70 00 16 01 ff 71 00 16 01 ff 48 00 01 04   ..p....q....H... ) putline
0 (0050  ff 03 07 00 24 00 01 01 05 25 00 01 01 05 26 00   ....$....%....&. ) putline
0 (0060  01 01 05 27 00 01 01 05 6a 00 01 01 00 6b 00 01   ...'....j....k.. ) putline
0 (0070  01 00 6c 00 01 01 00 6d 00 01 01 00 3d 00 01 02   ..l....m....=... ) putline
0 (0080  02 00 c0 00 03 08 80 00 00 00 00 00 00 00 b4 00   ................ ) putline
0 (0090  01 04 c0 a8 42 ef 39 00 16 08 05 05 05 05 00 00   ....B.9......... ) putline
0 (00a0  00 00 00 03 20 36 41 20 52 69 6e 67 00 00 00 00   .... 6A Ring.... ) putline
0 (00b0  00 00 00 00 00 00                                 ......           ) putline

% ---- ethereal finale start ---- %
% If this is not the first page, then print the page number
thispagenum 1 gt				% is thispagenum > 1 ?
{
	printpagenum
}
if

showpage
% ---- ethereal finale end ---- %