home *** CD-ROM | disk | FTP | other *** search
/ Computer Buyer 1997 October / DPCB1097.iso / Graphics / Draw7 / PROGRAMS / DATA / STARTUP.PS < prev    next >
Text File  |  1995-08-18  |  10KB  |  398 lines

  1.  %
  2.  %                    Copyright (c) 1990-1994  by
  3.  %            Pipeline Associates, Inc., Morris Plains, NJ
  4.  %                        All rights reserved.
  5.  %
  6.  %   This software is furnished under a license and may be used and
  7.  %   copied  only  in accordance with the terms of such license and
  8.  %   with the  inclusion  of  the  above  copyright  notice.   This
  9.  %   software  or  any  other copies thereof may not be provided or
  10.  %   otherwise made available to any other person except as allowed
  11.  %   under  license.  No  title to and ownership of the software is
  12.  %   hereby transferred.
  13.  %
  14.  %   This software is proprietary to Pipeline Associates, Inc., and
  15.  %   is not to be disclosed without written permission from Pipeline
  16.  %   Associates, Inc.
  17.  %
  18.  %   This file may not be changed without express written permission
  19.  %   of Pipeline Associates, Inc.
  20.  %
  21.  
  22. /TYPE4 false def
  23. /DLL 10 string (DLL) getenv {pop true def} {false def} ifelse
  24.  
  25. /#runpath 128 string (RUNPATH) getenv {def} {() def} ifelse
  26.  
  27. /PowerDoc false def
  28. /MESSAGES 10 string (MESSAGES) getenv {def} {(OFF) def} ifelse
  29. /SERVER 10 string (SERVER) getenv {def} { (NO) def } ifelse
  30.  
  31. PowerDoc {
  32.     /MESSAGES (OFF) def
  33. } if
  34.  
  35. $error /inerror false put
  36. MESSAGES (ON) eq {
  37. %(!cls)run
  38. ( ============================================================================) = flush
  39. ( |                 Begin PowerPage Level 2 /DOS execution                   |) = flush
  40. ( | Copyright (c) 1992, 1993 by Pipeline Associates, Inc., Morris Plains, NJ |) = flush
  41. ( |                          All rights reserved.                            |) = flush
  42. ( ============================================================================) = flush
  43. (\r\n\r\n) print flush
  44. } if
  45.  
  46. % /stderr (%stderr) (w) file def
  47.  
  48. /setpageparams {pop pop pop pop} def
  49. /#fontpath (fonts;/ps;/ps/kanji/fonts) def
  50.  
  51. /setrealdevice {pop pop} def
  52. /execjob {} def
  53. % The following for LW version 68 
  54.  
  55.  /flushfile {
  56.     userdict /md known {
  57.         /__str 32000 string def
  58.         /__file exch def
  59.         {
  60.             __file __str readline not  {
  61.                 exit 
  62.             } { 
  63.                 (cleartomark) eq { exit } if 
  64.             } ifelse
  65.         } loop
  66.     } {
  67.         systemdict /flushfile get exec
  68.     } ifelse
  69. } def
  70.  
  71. /=string 128 string def
  72. /a3 {} def
  73. /a4special {} def
  74.  
  75. /PRINTER 15 string (PRINTER) getenv {def} {() def} ifelse
  76. /CIE 15 string (CIE) getenv {def} {(ON) def} ifelse
  77. /RIBBONS 10 string (RIBBONS) getenv {def} {(1) def} ifelse
  78. /DEPTH 10 string (DEPTH) getenv {cvi def} {1 def} ifelse
  79. /SMOOTH 10 string (SMOOTH) getenv {def} {(ON) def} ifelse
  80. /PAPERSIZE 15 string (PAPERSIZE) getenv {def} {(letter) def} ifelse
  81. /GRAYSCALE 15 string (GRAYSCALE) getenv {def} {(ON) def} ifelse 
  82. /hres 10 string (RESOLUTION) getenv {cvi def} {1000 def} ifelse
  83. /vres 10 string (RESOLUTION) getenv {cvi def} {1000 def} ifelse
  84.  
  85. GRAYSCALE (ON) eq DEPTH 8 eq and {
  86.     /GRAYSCALE 1 def
  87. } {
  88.     /GRAYSCALE 0 def
  89. } ifelse
  90.  
  91. PRINTER () eq {
  92.     /A-size { statusdict begin [612 792] null [0 0] [0 0 0 0] genpaper end } def
  93.     /B-size { statusdict begin [792 1124] null [0 0] [0 0 0 0] genpaper end } def
  94. } if
  95.  
  96. MESSAGES (ON) eq DLL not and {
  97.     (Printer: ) print PRINTER print (\r\n) print
  98.     (Papersize: ) print PAPERSIZE print (\r\n) print
  99.  
  100.     (Ribbon colors: ) print RIBBONS (1) eq {
  101.         (Monochrome) 
  102.     }{
  103.         RIBBONS
  104.     } ifelse print (\r\n) print
  105.  
  106.     (Pixel depth: ) print DEPTH 10 string cvs print ( bits/pixel\r\n)print
  107.     (Resolution: ) print hres 10 string cvs print ( dpi\r\n)print
  108.     flush
  109. } if
  110.  
  111. /rerun {
  112.         $lastfilerun //run
  113. } def
  114.  
  115. /run {
  116.         /$lastfilerun exch def
  117.         $lastfilerun //run
  118. } def
  119.  
  120. /timerun {
  121.     <</OutputPage false>>setpagedevice
  122.     /time usertime def
  123.     systemdict /run get exec
  124.     usertime time sub timeprint
  125. } def
  126.  
  127. /timeprint {
  128.     1000 div (time (secs): ) print = flush
  129.     (\r\n)print flush
  130. } def
  131.  
  132. statusdict begin
  133. /product PRINTER () eq { (PowerPage) } { PRINTER } ifelse def
  134. /setbin {statusdict exch /$$bin exch put} def
  135. /currentbin {statusdict /$$bin get} def
  136. /$$bin 0 def
  137.  
  138. /cartstatus { pop 0 0 0 true } bind def
  139. end
  140.  
  141. true setglobal
  142. systemdict begin
  143. /_findfont /findfont load def
  144. /findfont {
  145.     systemdict /FontDirectory get exch 2 copy known 
  146.     { 
  147.         get
  148.     } {
  149.         exch pop 
  150.         /Font {findresource} stopped {
  151.             pop $error /command /findfont put stop
  152.         } if
  153.     } ifelse
  154. } bind def
  155. end
  156. false setglobal
  157.     
  158. (resource.ps)run
  159. % (setpage.ps) run
  160.  
  161. statusdict begin
  162. /genpaper {
  163.     << /Policies << /PageSize 7>> >> setpagedevice
  164.     statusdict begin 
  165.         /traydict 5 dict def
  166.         traydict begin
  167.             /PageMargins exch def
  168.             /Margins exch def
  169.             /ImagingBBox exch def
  170.             /PageSize exch def
  171.         end
  172.         traydict  setpagedevice 
  173.     end
  174. } def
  175. end
  176.  
  177.  
  178. true setglobal
  179.  
  180. % The "InvalidFont" font -- mimics Adobe's default font
  181.  
  182. 11 dict dup begin
  183. /FontInfo 9 dict dup begin
  184. /version (4/20/91 10:58 AM) readonly def
  185. /Notice(Copyright (C) 1993 by Pipeline Associates, Inc., All Rights Reserved)def
  186. /FullName (InvalidFont) readonly def
  187. /FamilyName (InvalidFont) readonly def
  188. /Weight (Medium) readonly def
  189. /ItalicAngle 0 def
  190. /isFixedPitch false def
  191. /UnderlinePosition 0 def
  192. /UnderlineThickness 0 def
  193. end readonly def
  194. /FontName /InvalidFont def
  195. /Encoding 256 array 0 1 255{1 index exch /.notdef put}for def
  196. /FontMatrix[1.0 0.0 0.0 1.0 0.0 0.0]def
  197. /CDevProc {11{pop}repeat 1 0 0 0 1 1 0 -1 .5 1}def
  198. /BuildChar {pop pop 1 0 0 0 1 1 0 -1 .5 1 setcachedevice2} def
  199. /FontType -1 def
  200. end
  201. /InvalidFont exch definefont pop
  202. false setglobal
  203.  
  204. % mark DEPTH RIBBONS cvi hres MEMdict /installdevice get exec
  205.  
  206. /InvalidFont findfont setfont
  207.  
  208. %
  209. % load Level 2 default CIE color rendering dictionary 
  210. %
  211. CIE (ON) eq {
  212.     %
  213.     %
  214.     % PhotoShop friendly default CRD
  215.     %
  216.     systemdict /setcolorrendering known {
  217.         6 dict begin
  218.             /ColorRenderingType 1 def
  219.             /MatrixLMN [2.951 -1.085 .0864
  220.                 -1.289 1.991 -.2711
  221.                 -.4738 .0372  1.0910] def
  222.             /EncodeLMN  [ {dup 0 lt {pop 0} {
  223.                 dup 1 gt {pop 1} {0.555555 exp} ifelse} 
  224.                 ifelse} dup dup] def
  225.             /WhitePoint  [.9505 1 1.0891] def
  226.             /TransformPQR [ {} {} {} ] def
  227.             /PipelineCIEDefault 1 def
  228.             currentdict
  229.         end setcolorrendering
  230.     }if
  231. }{
  232.     % Old-style 'do-nothing' default CRD
  233.     %
  234.     systemdict /setcolorrendering known {
  235.         3 dict begin
  236.             /ColorRenderingType    1 def
  237.             /WhitePoint    [0.9505 1.0 1.089] def
  238.             /TransformPQR [ {} {} {} ] def
  239.             currentdict
  240.         end setcolorrendering
  241.     }if
  242. } ifelse
  243.  
  244.  
  245. RIBBONS (4) eq {
  246.     {pop 0} setundercolorremoval
  247.     {pop 0} setblackgeneration
  248. } if
  249.  
  250. /letter {statusdict begin [612 792] null [0 0] [0 0 0 0] genpaper end} def
  251. /landscape {statusdict begin [792 612] null [0 0] [0 0 0 0] genpaper end} def
  252. /Letter {statusdict begin [612 792] null [0 0] [0 0 0 0] genpaper end} def
  253. /11x17 {statusdict begin [792 1224] null [0 0] [0 0 0 0] genpaper end} def
  254. /tabloid {statusdict begin [792 1224] null [0 0] [0 0 0 0] genpaper end} def
  255. /Tabloid {statusdict begin [792 1224] null [0 0] [0 0 0 0] genpaper end} def
  256. /Legal { statusdict begin [612 1008] null [0 0] [0 0 0 0] genpaper end } def
  257. /legal { statusdict begin [612 1008] null [0 0] [0 0 0 0] genpaper end } def
  258. /A4 { statusdict  begin [595 842]  null [0 0] [0 0 0 0] genpaper end } def
  259. /a4 { statusdict  begin [595 842]  null [0 0] [0 0 0 0] genpaper end } def
  260. /note {initgraphics} def
  261. /a3 {initgraphics} def
  262. /custom { 
  263.     <</HWResolution [200 200] /PageSize [1440 2160] /ImagingBBox null
  264.        /PageMargins [0 0 0 0]>> setpagedevice 
  265. } def    
  266.  
  267. %
  268. % Now install the appropriate paper size
  269. <<    
  270.     /PageSize [612 792]
  271.     /ImagingModel 4 
  272.     /ColorDepth DEPTH
  273.     /Colors RIBBONS cvi 
  274.     /HWResolution [hres vres]
  275.     /GrayScale GRAYSCALE 
  276.     /Yorient 1           % Page flipped vertically if -1, normal if 1
  277.      /OutputProc { }
  278. >> setpagedevice
  279.  
  280. %DLL {
  281. %    10 string (HIRES) getenv {
  282. %         << /OutputProc { (c:/pwrpage/page) (bmp24) writepage } >> setpagedevice
  283. %    <</OutputPage false>>setpagedevice
  284. %    } {
  285. %         << /OutputProc { (c:/pwrpage/page) (bmp) writepage } >> setpagedevice
  286. %    } ifelse
  287. %} {
  288.     % << /OutputProc { (c:/pwrpage/page) (bmp) writepage } >> setpagedevice
  289.     % << /OutputProc { (c:/tmp/page.out) (bin) writepage } >> setpagedevice
  290. %     << /OutputProc { (page.bmp) (bmp) writepage } >> setpagedevice
  291. %} ifelse
  292.  
  293. PAPERSIZE cvx exec  
  294.  
  295. statusdict begin 
  296.     /lettertray {} def 
  297.     /11x17tray {} def 
  298.     /setpapertray {pop} def
  299. end
  300.  
  301. DLL {
  302.     mark 256 2000 setcacheparams
  303. } {
  304.     mark 2000 10000 setcacheparams
  305. } ifelse
  306.  
  307. /timeit {
  308.     /S__1 save def
  309.     dup print (: ) print 
  310.     timerun 
  311.     clear
  312.     S__1 restore
  313. } def
  314.  
  315.  
  316. false echo
  317.  
  318. systemdict begin 
  319.     true setglobal
  320.     /cexec { pop } def
  321.     /devformat { pop pop pop } bind def
  322.     /product (PowerPage) def
  323.     false setglobal
  324. end
  325.  
  326. true setglobal
  327. (ROMFONT1)run
  328. false setglobal
  329.  
  330. %
  331. % Initiialize Type4 font support if necessary 
  332. %
  333. TYPE4 { (type4.ps) run } if
  334.  
  335. {pop 0} setundercolorremoval
  336. {} setblackgeneration
  337.  
  338. /OLDSMOOTH (XXX) def
  339.  
  340. statusdict begin
  341.     mark currentscreen counttomark array astore exch pop /DEFAULTSCREEN exch def
  342. end
  343.  
  344. /setsmoothing {
  345.     10 string (SMOOTH) getenv {
  346.         dup  dup
  347.         OLDSMOOTH ne {
  348.             (ON) eq {
  349.                 (Smoothing turned on for next job\r\n) print flush
  350.     
  351.                 26.5 45
  352.                 {
  353.                     dup 0 lt { 1 add } if exch
  354.                     dup 0 lt { 1 add } if exch
  355.                     .49 sub 2 mul exch .48 sub 2 mul
  356.                     abs exch abs dup 2 index add 1.1 le
  357.                     {dup mul exch dup mul add 2 div 1 exch sub}
  358.                     {1 exch sub dup mul exch 1 exch sub dup mul add 2 div 1 sub}
  359.                     ifelse
  360.                 }
  361.             } {
  362.                     (Smoothing turned off for next job\r\n) print flush 
  363.  
  364.                 statusdict /DEFAULTSCREEN get aload pop 
  365.             } ifelse
  366.             
  367.             setscreen
  368.         } {
  369.             pop
  370.         }
  371.         ifelse
  372.  
  373.         /OLDSMOOTH exch def
  374.     } if
  375. } bind def
  376.     
  377. setsmoothing
  378. MEMdict pop    % Ensure that MEMdict gets initialized at lowest save level.
  379.  
  380. SERVER (YES) eq {
  381.     MESSAGES (ON) eq {
  382.         (Running PostScript job server\n)print flush
  383.     } if
  384.     (server2.ps)run
  385.     userdict /start {serve} put
  386. } {
  387.     save pop
  388. } ifelse
  389.  
  390. vmstatus sub neg exch pop .6 mul cvi setvmthreshold
  391.  
  392. MESSAGES (ON) eq {
  393.     (Waiting for PostScript job...\n)print flush
  394. } if
  395.  
  396.  
  397.