2 %% Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
6 %% This PostScript file is used as input to tsol_labeled_banner,
7 %% which will prepend code to set the values of a number of
10 %% This PostScript file may be modified for local customizations or
11 %% internationalization. Comments marked "INTERNATIONALIZE:" show
12 %% places where changes may be made for internationalization. Comments
13 %% marked "CUSTOMIZE:" show places where some typical customization
14 %% changes may be made.
17 %% The following comments describe variables set by tsol_labeled_banner
19 %% These variables are from the print job information that can be
20 %% displayed with lpstat or lpq.
22 %% /Job_Classification The classification (from the sensitivity label) to
23 %% be displayed at the top and bottom of the banner
24 %% /Job_Printer Printer Name
25 %% /Job_Host Host job was submitted from
26 %% /Job_User User who submitted the job
27 %% /Job_JobID Job number
28 %% /Job_Title Job title
30 %% Job Page labels are added in pstops filter, so page labels should not be
33 %% /Job_DoPageLabels Print page labels NO.
35 %% These variables are generated from the system clock value.
37 %% /Job_Date Date and time the job is being printed, in the
38 %% locale's default format
39 %% /Job_Hash A randomly generatred identifying number for
40 %% matching up the banner and trailer pages of the job
43 %% The following variables are the job's labels
44 %% as interpreted by the bcltobanner(3TSOL) library routine.
46 %% /Job_Classification The classification (from the sensitivity label) to be
47 %% displayed at the top and bottom of the banner page.
48 %% /Job_Protect The sensitivity label to be displayed in the protect-as
50 %% /Job_Caveats The caveats from the sesitivity label.
51 %% /Job_Channels The channels from the sesitivity label.
54 %% The following variables are the job's Sensitivity Label and
55 %% Information Label as interpreted by the bsltos and biltos library
58 %% /Job_SL_Internal The sensitivity label in internal view format.
59 %% /Job_SL_External The sensitivity label in external view format.
61 /SeparatorPagesDict 100 dict def
62 userdict /JobDict known not {
63 userdict /JobDict 100 dict put
69 %% CUSTOMIZE: To print header page label left-justified, set this to false
70 /center_label true def
78 2 div neg exch rmoveto show
87 1 index length 1 index length add
88 1 index dup type /dicttype eq
98 /arraytype eq { array } { string } ifelse
99 dup 4 -1 roll 1 index copy length 4 -1 roll putinterval
106 systemdict /fontheight known
107 { systemdict /fontheight get }
111 setfont (qf) true charpath flattenpath pathbbox
112 4 -1 roll pop exch pop exch sub
123 currentpoint exch pop
124 currentfont fontheight sub errorx0 exch moveto
129 dup stringwidth pop MaxWidth gt {
131 dup stringwidth pop (<-) stringwidth pop add MaxWidth le {exit} if
132 dup 0 exch length 1 sub getinterval
135 %% Concatenate strings
136 dup length 2 index length add 1 index pop string
137 dup 0 4 index putinterval
138 dup 4 -1 roll length 4 -1 roll putinterval
144 {restoftext ( ) search
146 /blank_nextword exch def pop
147 /blank_restoftext exch def
148 /blank_wordwidth blank_nextword stringwidth pop def
150 restoftext (/) search
152 /slash_nextword exch def pop
153 /slash_restoftext exch def
154 /slash_wordwidth slash_nextword stringwidth pop def
156 blank_wordwidth slash_wordwidth lt
158 /nextword blank_nextword def
159 /restoftext blank_restoftext def
160 /wordwidth blank_wordwidth def
161 /breakwidth ( ) stringwidth pop def
164 /nextword slash_nextword def
165 /restoftext slash_restoftext def
166 /wordwidth slash_wordwidth def
167 /breakwidth (/) stringwidth pop def
172 /nextword blank_nextword def
173 /restoftext blank_restoftext def
174 /wordwidth blank_wordwidth def
175 /breakwidth ( ) stringwidth pop def
178 curwidth wordwidth add linewidth gt
179 {textstring startchar
180 lastwordbreak startchar sub
182 /startchar lastwordbreak def
183 /curwidth wordwidth breakwidth add def }
185 {/curwidth curwidth wordwidth add
188 /lastwordbreak lastwordbreak
189 nextword length add 1 add def
191 {pop BreakWithSlashes exit}
199 /breakwidth breakchar stringwidth pop def
200 {restoftext breakchar search
201 {/nextword exch def pop
203 /wordwidth nextword stringwidth pop def
205 curwidth wordwidth add linewidth gt
206 {textstring startchar
207 lastwordbreak startchar sub
209 /startchar lastwordbreak def
210 /curwidth wordwidth breakwidth add def }
212 {/curwidth curwidth wordwidth add
215 /lastwordbreak lastwordbreak
216 nextword length add 1 add def
225 /linewidth exch 40 sub def
231 /restoftext textstring def
233 % begin scale the font if necessary
235 /allowedarea linewidth fbh 10 div mul def
236 /currentarea currentfont fontheight textstring stringwidth pop mul def
238 currentarea allowedarea gt
240 currentfont allowedarea currentarea div scalefont setfont
243 % end scale the font if necessary
246 /lastchar textstring length def
247 textstring startchar lastchar startchar sub
253 JobDict /Job_Proclam? get {
254 systemdict /showpage get cvx exec
265 clippath pathbbox /fbh exch def
272 /margin fbh 20 div def
273 /imargin margin 1.1 mul def
275 /errorx1 fbw imargin sub def
281 % this stuff is lpd dependant.
288 % If Job_Printer is defined, assume the others are too,
292 /Job_Proclam? true def
293 /Job_Endclam? true def
295 /Printer Job_Printer def
302 %% CUSTOMIZE: To use a different string at the top and
303 %% bottom of each page, change the following line. For
304 %% instance, to use the sensitivity label in external view
305 %% format, change the line to: /PageLabel Job_SL_External def
306 %% To eliminate page labels completely, change this line to
307 %% set the page label to an empty string: /PageLabel () def
308 /PageLabel Job_SL_Internal def
311 %% Job_Protect is empty because SLs are turned
312 %% off in secconf. (Turning off SLs is actually not yet
313 %% supported by the system.)
315 /Protect_Text1 () def
316 /Protect_Text2 () def
319 %% INTERNATIONALIZE/CUSTOMIZE: Replace the text between
320 %% parentheses with the appropriate text to display
321 %% above and below the SL.
322 /Protect Job_Protect def
323 /Protect_Text1 (This output must be protected as:) def
324 /Protect_Text2 (unless manually reviewed and downgraded.) def
328 %% CUSTOMIZE: To not print the caveats, change
329 %% this line to /Caveats () def
330 /Caveats Job_Caveats def
331 %% CUSTOMIZE: To not print the channels, change
332 %% this line to /Channels () def
333 /Channels Job_Channels def
335 %% CUSTOMIZE: To not print the hash number, change
336 %% this line to /Hash () def
339 %% CUSTOMIZE: To not print the head label, change
340 %% this line to /HeadLabel () def
341 %% You may also substitute another string. For example, to use
342 %% the SL in internal view format: /HeadLabel Job_SL_Internal def
343 /HeadLabel Job_Classification def
345 /Job_Proclam? false def
346 /Job_Endclam? false def
360 60 currentlinewidth 2 div sub fbw sub 0 rlineto
368 /fontscale fbh 50 div def
369 /Courier-Bold findfont fontscale scalefont setfont
371 JobDict /HeadLabel get
372 SeparatorPagesDict /fbw get 90 sub
373 SeparatorPagesDict /clipSL get exec
377 ClippedLabel stringwidth pop 5 add
378 HeadLabel () eq { pop 0 } if
381 fbw 2 div head_len 2 div sub -20 moveto
382 head_len 0 rlineto stroke
384 fbw 10 div -25 m gsave ClippedLabel
385 currentpoint exch pop fbw 2 div exch moveto
386 center_show NewLine grestore
389 /fontscale fbh 70 div def
391 /Helvetica findfont fontscale scalefont setfont
392 0 fbh 8 div neg r Protect_Text1
393 currentpoint exch pop
395 fbw 2 div exch moveto center_show
398 fbw 10 div exch moveto show
401 /fontscale fbh 60 div def
402 /Helvetica-Bold findfont fontscale scalefont setfont
406 fbw errorx0 3 mul sub % width minus margins
409 {NewLine currentpoint exch pop fbw 2 div exch moveto center_show}
413 {NewLine currentpoint exch pop fbw 10 div exch moveto show}
418 /fontscale fbh 70 div def
419 /Helvetica findfont fontscale scalefont setfont
420 0 fbh 50 div neg r Protect_Text2
421 currentpoint exch pop
423 fbw 2 div exch moveto center_show
426 fbw 10 div exch moveto show
430 /fontscale fbh 60 div def
431 /Helvetica-Bold findfont fontscale scalefont setfont
436 /fontscale fbh 40 div def
437 /Helvetica-Bold findfont fontscale scalefont setfont
439 0 fbh 30 div neg r gsave
440 %% INTERNATIONALIZE: Replace the text between
441 %% parentheses with the appropriate text.
442 (User: ) User (@) Host append append append
443 currentpoint exch pop fbw 2 div exch moveto center_show
445 0 fbh 30 div neg r gsave
446 %% INTERNATIONALIZE: Replace the text between
447 %% parentheses with the appropriate text.
449 currentpoint exch pop fbw 2 div exch moveto center_show
451 0 fbh 30 div neg r gsave
453 currentpoint exch pop fbw 2 div exch moveto center_show
455 /fontscale fbh 70 div def
456 /Helvetica findfont fontscale scalefont setfont
457 0 fbh 30 div neg r gsave
458 %% INTERNATIONALIZE: Replace the text between
459 %% parentheses with the appropriate text.
460 (Printed at: ) Date append
461 currentpoint exch pop fbw 2 div exch moveto center_show
463 0 fbh 30 div neg r gsave
464 %% INTERNATIONALIZE: Replace the text between
465 %% parentheses with the appropriate text.
466 (Printer queue: ) Printer append
467 currentpoint exch pop fbw 2 div exch moveto center_show
470 /Helvetica-Bold findfont fontscale scalefont setfont
473 fbw errorx0 3 mul sub % width minus margins
474 {NewLine currentpoint exch pop fbw 2 div exch moveto center_show}
479 fbw errorx0 3 mul sub % width minus margins
480 {NewLine currentpoint exch pop fbw 2 div exch moveto center_show}
483 /fontscale fbh 50 div def
484 /Courier-Bold findfont fontscale scalefont setfont
486 fbw 2 div head_len 2 div sub 40 fbh sub moveto
487 head_len 0 rlineto stroke
489 fbw 10 div 35 fbh sub m gsave ClippedLabel
490 currentpoint exch pop fbw 2 div exch moveto center_show
499 /fontscale fbh 50 div def
500 /Helvetica-Bold findfont fontscale scalefont setfont
504 fbw 12 div 50 neg m gsave show grestore
508 fbw 12 div fbh 60 sub neg m gsave show grestore
510 %% Lower right corner
511 Hash dup stringwidth pop
512 fbw 11 mul 12 div exch sub fbh 60 sub neg m gsave show grestore
514 %% Upper right corner
515 Hash dup stringwidth pop
516 fbw 11 mul 12 div exch sub 50 neg m gsave show grestore
518 /fontscale fbh 40 div def
519 /Helvetica-Bold findfont fontscale scalefont setfont
520 fbw 10 div 120 fbh sub m gsave
521 currentpoint exch pop fbw 2 div exch moveto center_show
531 %% INTERNATIONALIZE: Replace the text between
532 %% parentheses with the appropriate text.
533 { TSOLJobInfo (JOB START) JobHashInfo}
543 %% INTERNATIONALIZE: Replace the text between
544 %% parentheses with the appropriate text.
545 { TSOLJobInfo (JOB END) JobHashInfo}
560 % A fancy box around page
571 % -------------------------------------------------------------------------
573 % The structure of separator pages is defined below. This is invoked by
576 % SeparatorPagesDict /Banner get exec
599 /SkipPageLabels false def
602 SeparatorPagesDict begin
603 clippath pathbbox /fbh exch def
610 JobDict /Job_DoPageLabels get (YES) eq
611 JobDict /PageLabel get () ne and {
614 systemdict /showpage get cvx exec
619 %% End of tsol_separator.ps