Google
 

Trailing-Edge - PDP-10 Archives - SRI_NIC_PERM_FS_1_19910112 - system/landscape.ps
There is 1 other file named landscape.ps in the archive. Click here to see a list.
%!-Adobe-1.0
% Routine to convert straight text files to landscape mode.
% output headers if defined.
%	Inputs:	
%		File_Name - String to placed in Header line (filename)
%		date      - Date String
%		time	  - Time string
%		page	  - Starting page number (Optional)
%
/in.	{72 mul}	def
/line	512	string def	% for input line buffering
/buff	10	string def	% for page number conversion


/leftmargin where not
    { /leftmargin .75 in. def } {pop} ifelse
/bottom where not
    { /bottom .3 in. def } {pop} ifelse
/startX where not
    { /startX leftmargin def } {pop} ifelse
/startY where not
    { /startY 10 in. def } {pop} ifelse
/fontname where not
    { /fontname /Courier def } {pop} ifelse
/pointsize where not
    { /pointsize 11 def } {pop} ifelse
/leading where not
    { /leading pointsize 1 add def } {pop} ifelse
/top  {startY leading sub} def
/headerfontname where not
    { /headerfontname /Courier-Bold def } {pop} ifelse
/headerpointsize where not
    { /headerpointsize 10 def } {pop} ifelse
/headerfont
    headerfontname findfont headerpointsize scalefont
def
/page where not
    { /page 1 def } {pop} ifelse
/pagenumber where not
    { /pagenumber true def } {pop} ifelse

/boxfontname where not
    { /boxfontname /Times-Bold def } {pop} ifelse
/boxpointsize where not
    { /boxpointsize 25 def } {pop} ifelse
/boxfont
    boxfontname findfont boxpointsize scalefont
def
/center {
    stringwidth
    pop
    2 div
    sub
    exch
    moveto
    } def
/determine_size {
	gsave
	2 copy stringwidth pop
	sub
	0 le
	{currentfont [.95 0 0 .95 0 0] makefont setfont determine_size}
	{exch pop			%get rid of the width
	center
	show} ifelse
	grestore
	} def
/replace_tabs {
	(	) search
	{mark exch dup show length 8 mod  1 7 {( ) show} for cleartomark 
	    pop replace_tabs}
	{show} ifelse
    } def
/form_feeds {
	(
) search
	{replace_tabs pop showpage 5 797 translate -90 rotate  .77 .77 scale 
	 printheader form_feeds}
	{replace_tabs} ifelse
    } def
% This routine will print a header at the top of each page
/printheader {
    gsave
	currentdict /File_Name known {
	    .9 setgray
	    newpath    
	    .75 in. 10.3 in. moveto    
	    .75 in. 10.8 in. lineto    
	    2.0 in. 10.8 in. lineto    
	    2.0 in. 10.3 in. lineto    
	    closepath    
	    fill
	    .7 setgray
	    newpath    
	    11.6 in. 10.3 in. moveto    
	    11.6 in. 10.8 in. lineto    
	    12.85 in. 10.8 in. lineto    
	    12.85 in. 10.3 in. lineto    
	    closepath    
	    fill
	    .975 setgray
	    newpath    
	    2.0 in. 10.3 in. moveto    
	    2.0 in. 10.5 in. lineto    
	    11.6 in. 10.5 in. lineto    
	    11.6 in. 10.3 in. lineto    
	    closepath    
	    fill
	    0 setgray
	    headerfont setfont
	    date 10.47 in. 1.35 in. 108 date determine_size
	    time 10.33 in. 1.35 in. 108 time determine_size
	    File_Name 10.35 in. 6.4 in. 550 File_Name determine_size
	} if
	pagenumber {
	    1 setgray
	    boxfont setfont
	    page buff cvs 10.33 in. exch 12.2 in. exch center
	    page buff cvs show
	    /page page 1 add def
	    0 setgray
	} if
    grestore
    /Y startY def
    startX startY moveto
} bind def

/crlf {
    leftmargin currentpoint exch pop	% replace X with leftmargin
    leading sub 
    dup bottom le
    { pop pop showpage 5 797 translate -90 rotate  .77 .77 scale printheader}
    { moveto } ifelse
} bind def

/printfile {
    line readline		% read a line from the file
    {				% 'if' procedure body (+boolean)
	{			% 'while' procedure body
	    form_feeds crlf	% show what's left by readline
	    currentfile cvlit	% use as operand
	    line readline	% and read the next line
	    not {exit} if	% exit if no more input to be had
	} loop			% end of while-proc
    } if
    showpage			% when input file is exhausted
} bind def			% /printfile

fontname findfont pointsize scalefont setfont

5 797 translate -90 rotate  .77 .77 scale
printheader		% execute header
currentfile cvlit	% uses rest of this file as input

% everything following 'PrintFile' is treated as data, through EOF
printfile