home *** CD-ROM | disk | FTP | other *** search
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% init.ps: this file is read in to the PostScript interpreter as %%
- %% soon as all the built-in operators have been defined. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
- true setglobal
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Time to load in some standard PostScript files. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- (%lib%utils.ps) run
-
- (%lib%errordict.ps) run
-
- (%lib%resources.ps) run
-
- (%lib%statusdict.ps) run
-
- (%lib%local.ps) run
-
-
- %% Added so that font decoding (not encoding!) is available always,
- %% everywhere. C.C. - 2/26/96
- (%lib%decoding.ps) run
-
- /TProSpot
- {
- exch pop
- } binddef
-
-
- /TestHalfTone <<
- /HalftoneType 3
- /Width 4
- /Height 4
- /Thresholds <
- 00 44 66 88
- ff 11 aa ee
- 99 77 22 cc
- dd bb 55 33
- >
- >> /Halftone defineresource
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Define the job server and other contents of serverdict %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- systemdict /serverdict 16 dict put
- serverdict begin
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% The following variable says whether you get a looping or a %%
- %% single-shot job server. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /onejobonly false def
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% setdefaultdevice simply applies all the initial values %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
-
- /setdefaultdevice {
- %% serverdict /initialdevicedict get setpagedevice
- /DefaultType1Halftone /Halftone findresource sethalftone
- /DefaultColorRendering /ColorRendering findresource setcolorrendering
- } binddef
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% The initial page device dictionary sets a fairly minimal set %%
- %% of values. %%
- %% %%
- %% The /OutputDevice string selects the an appropriate TPro device %%
- %% driver, as described in the manual. %%
- %% %%
- %% Some devices (such as (fileband;roll;....) have strange initial %%
- %% page sizes. On such a device, PS jobs which don't explicitly %%
- %% select a paper size will produce odd looking results. When %%
- %% using such a device, you should add a /PageSize entry to the %%
- %% initial dictionary, like the one below. This will get overridden%%
- %% by any job that really does request a page size. %%
- %% %%
- %% I set the page size policy to 3, so that requests for weird %%
- %% paper sizes get the page scaled to fit the available paper. This %%
- %% is not what is described in the PLRM, but is quite useful. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- %%/initialdevicedict <<
- %% /PageDeviceName /Default
- %% /OutputDevice
- %% (filepage;format=tiffpackbits;filename=c:/tpro%03d.out)
- %% /BeginPage {pop}
- %% /EndPage {exch pop 2 ne}
- %% /Install {
- %% }
- %% /Policies <<
- %% /PolicyNotFound 0
- %% /PageSize 3
- %% >>
- %% /PageSize [612 792]
- %%>> def
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% You may also want to establish a default set of user parameters %%
- %% that get applied to each job. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /initialuserparams <<
- /IgnoreDOSChars true
- %% /AccurateScreens true
- %% /CMYKOverprint true
- %% /CommentDict << /CommentNotFound {==} >>
- >> def
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Finally, there is the job server itself. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- /server {
- serverdict /setdefaultdevice get exec
- {
- clear cleardictstack
- serverdict /stdin (%stdin) (r) file put
- save serverdict /serversave 3 -1 roll put
- /quit /stop load def
- false setglobal
- serverdict /initialuserparams get setuserparams
- serverdict /stdin get cvx stopped {
- $error /newerror get {
- $error /errorname get
- false errordict /backstoperrors get {
- 2 index eq {pop true exit} if
- } forall
- {
- errordict begin errorbackstop end
- } {
- errordict begin handleerror end
- } ifelse
- $error /binary get currentobjectformat 0 ne and not {
- (%%[ Flushing: rest of job (to end-of-file) will be ignored ]%%) =
- flush
- } if
- serverdict /stdin get flushfile
- } if
- } if
- clear cleardictstack
- serverdict /serversave get dup null ne
- {restore} {pop clearerrorstacks} ifelse
- serverdict /endjob get exec
- serverdict begin
- /serversave null store
- stdin closefile
- /stdin null store
- end
- serverdict /onejobonly get {exit} if
- } loop
- } binddef
-
- /serversave null def
-
- /endjob /endjob load def
- systemdict /endjob undef
-
- /exitserver {
- true exch startjob not {
- /exitserver errordict /invalidaccess get exec
- } {
- (%%[ exitserver: permanent state may be changed ]%%\n) print flush
- } ifelse
- } binddef
-
- systemdict /startjob {
- checkjobpassword
- vmstatus pop pop serverdict /serversave get
- null ne {1} {0} ifelse le and {
- count 1 gt {count 1 roll} if
- count 1 sub {pop} repeat
- cleardictstack
- serverdict /serversave get dup null eq {
- pop true
- } {
- {restore} stopped {
- pop false
- } {
- serverdict /endjob get exec
- serverdict /serversave null put
- false setglobal
- true
- } ifelse
- } ifelse
- exch not 1 index and {
- %% Start encapsulated job
- save serverdict /serversave 3 -1 roll put
- /quit /stop load def
- false setglobal
- } if
- } {
- pop false
- } ifelse
- } bind put
-
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Until now, systemdict has been writable. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- systemdict readonly pop
-
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
- %% %%
- %% Everything's ready, so start the job server. %%
- %% %%
- %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-
- serverdict /server get exec
-
-