home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 1997 August / Personal_Computer_World_Aug_97.iso / multi / xres / data.z / OPI.PS < prev    next >
Encoding:
Text File  |  1995-10-30  |  1.8 KB  |  72 lines

  1. %!
  2. %%VMusage: 0 0
  3. %%VMlocation: global
  4. %%
  5. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  6. %%                                    %%
  7. %% OPIProcSet: procedures to go into CommentDict to enable basic    %%
  8. %% OPI processing.                            %%
  9. %%                                    %%
  10. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  11.  
  12.  
  13. /OPIProcSet <<
  14.  
  15. /Initialise {
  16.   userdict /OPIinitialised? known {
  17.     userdict /OPIinitialised? get
  18.   } {
  19.     false
  20.   } ifelse
  21.   not {
  22.     currentglobal false setglobal
  23.     userdict /OPIdocomment {
  24.       exch OPIdict 3 1 roll put
  25.     } put
  26.     userdict /OPIdoobject {
  27.       /OPIProcSet /ProcSet findresource begin DoObject end
  28.     } put
  29.     userdict /OPIdict 8 dict put
  30.     userdict /OPIinitialised? true put
  31.     setglobal
  32.   } if
  33. } bind
  34.  
  35. /CommentDict <<
  36.   /ALDImageFileName {/ALDImageFileName OPIdocomment}
  37.   /ALDImageID {/ALDImageID OPIdocomment}
  38.   /ALDImageCropRect {/ALDImageCropRect OPIdocomment}
  39.   /ALDImagePosition {/ALDImagePosition OPIdocomment}
  40.   /ALDImageColor {/ALDImageColor OPIdocomment}
  41.   /ALDImageTint {/ALDImageTint OPIdocomment}
  42.   /ALDImageTransparency {/ALDImageTransparency OPIdocomment}
  43.   /ALDImageGrayMap {/ALDImageGrayMap OPIdocomment}
  44.   /BeginObject {pop OPIdoobject}
  45. >>
  46.  
  47. /DoObject {
  48.   userdict /OPIdict get dup /ALDImageFileName known exch /ALDImageID known or {
  49.     userdict /OPIdict get {OPI_image} stopped {
  50.       (%%[ OPI substitution failed; using low resolution image ]%%) = flush
  51.       pop
  52.     } {
  53.       1 dict begin
  54.       /junk 2048 string def
  55.       {
  56.         currentfile junk {readline} stopped {
  57.           pop pop
  58.         } {
  59.            not {stop} if
  60.            (%%EndObject) eq {exit} if
  61.         } ifelse
  62.       } loop
  63.       end
  64.     } ifelse
  65.   } if
  66. } bind
  67.  
  68. >> /ProcSet defineresource
  69.  
  70. dup /Initialise get exec
  71.  
  72.