home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD 12 / 12_pcplus_supercd.iso / COMUN / NWMAC / NW_MAC / ATPS.BNR < prev    next >
Encoding:
Text File  |  1993-10-05  |  3.7 KB  |  144 lines

  1. % ------
  2. % ATPS.BNR                         10/5/93
  3. % ------
  4. %
  5. %      This is an example external PostScript banner for use with
  6. %  ATPS.NLM.  By default, when the ATPS print server prints a banner,
  7. %  it does this by sending the printer PostScript or text data which is built
  8. %  into ATPS.NLM.  The external banner capability of ATPS allows you to replace
  9. %  the default PostScript banner with one customized to your environment.
  10. %  You could modify the banner to use a different font, include your
  11. %  organization's logo, or be localized to your language and locale.
  12. %
  13. %    When a version of ATPS.NLM that supports the external banner
  14. %  tries to print a PostScript banner, it goes through the following steps:
  15. %
  16. %    1) transmits 9 strings with information about the print job
  17. %    2) transmits an optional message string definition (for example,
  18. %        the text of a PostScript error)
  19. %    3) checks for the existence of SYS:SYSTEM\NW-MAC\ATPS.BNR
  20. %    4) transmits the contents of this file, or the ATPS internal banner
  21. %        if it is not present
  22. %    5) waits for confirmation from the printer that the banner has
  23. %        been output
  24. %
  25. %  The banner PostScript code should use the string operands previously
  26. %  pushed on the stack to generate a banner.  It should also
  27. %  check to see if the optional message string has been defined,
  28. %  and, if so, include the message on the banner.  Your finished ATPS.BNR
  29. %  file should be placed in SYS:SYSTEM\NW-MAC for use by ATPS.  This
  30. %  sample print out the standard ATPS banner in a different font.
  31. %
  32. %  The strings are transmitted in this order, and are thus present on the
  33. %  stack in the *reverse* order:
  34. %  string 1    the localized date
  35. %  string 2    the localized time
  36. %  string 3    the server name
  37. %  string 4    the queue name
  38. %  string 5    the job's description
  39. %  string 6    the job owner's NetWare name
  40. %  string 7    the job number (in hexadecimal format)
  41. %  string 8    the job's file name (set in Printcon for DOS users)
  42. %  string 9    the job's user name (set in Printcon for DOS users)
  43. %
  44. % ---------
  45. % VARIABLES
  46. % ---------
  47.  
  48. /HeaderFont
  49.     /Helvetica findfont 12 scalefont def
  50. /NameFont
  51.     /Helvetica findfont 30 scalefont def
  52. /MsgFont
  53.     /Helvetica findfont 18 scalefont def
  54. /BordStart {72 72} def
  55. /BordTall 632 def
  56. /BordWide 468 def
  57. /ShadeStart {500 72} def
  58. /ShadeWide 39 def
  59. /HeadOff {18 BordTall 18 sub} def
  60.  
  61. % ----------
  62. % PROCEDURES
  63. % ----------
  64.  
  65. /doborder    % draws the border
  66. { newpath
  67.     BordStart moveto
  68.     0 BordTall rlineto
  69.     BordWide 0 rlineto
  70.     0 BordTall neg rlineto
  71.     closepath
  72.     .5 setlinewidth
  73.     stroke } def
  74.  
  75. /doshade    % print a shaded strip along the right edge
  76. { gsave
  77.     newpath
  78.     ShadeStart moveto
  79.     0 BordTall rlineto
  80.     ShadeWide 0 rlineto
  81.     0 BordTall neg rlineto
  82.     closepath
  83.     .9 setgray
  84.     fill
  85.     grestore} def
  86.  
  87. /HeaderPosition        % move to the upper left of the top panel
  88. { BordStart moveto
  89.     HeadOff rmoveto
  90.     rmoveto } def
  91.  
  92. /domsg        % print the message text
  93. { MsgFont setfont
  94.     0 -340 HeaderPosition
  95.     /MsgText load show } def
  96.  
  97. /doheader    % print the bannner information
  98. { NameFont setfont
  99.     96 -24 HeaderPosition
  100.     show
  101.     HeaderFont setfont
  102.     0 -66 HeaderPosition
  103.     (Job Name: ) show
  104.     96 -66 HeaderPosition
  105.     show
  106.     0 -90 HeaderPosition
  107.     (Job Number: ) show
  108.     96 -90 HeaderPosition
  109.     show
  110.     0 -114 HeaderPosition
  111.     (User Account: ) show
  112.     96 -114 HeaderPosition
  113.     show
  114.     0 -138 HeaderPosition
  115.     (Description: ) show
  116.     96 -138 HeaderPosition
  117.     show
  118.     0 -162 HeaderPosition
  119.     (Queue: ) show
  120.     96 -162 HeaderPosition
  121.     show
  122.     0 -186 HeaderPosition
  123.     (Server: ) show
  124.     96 -186 HeaderPosition
  125.     show
  126.     0 -210 HeaderPosition
  127.     (Time and date: ) show
  128.     96 -210 HeaderPosition
  129.     show
  130.     (  ) show
  131.     show } def
  132.  
  133. % ------------
  134. % MAIN PROGRAM
  135. % ------------
  136.  
  137. doborder
  138. doheader
  139. doshade
  140. userdict /MsgText known {domsg} if
  141. showpage
  142.  
  143.