home *** CD-ROM | disk | FTP | other *** search
/ DTP Toolbox / DTPToolbox.iso / propage4.0 / arexx / psprintinfo.pprx < prev    next >
Encoding:
Text File  |  1992-08-24  |  4.3 KB  |  161 lines

  1. /*
  2. @BPSPrintInfo  @P@Iby Robin Evans, April, 1992
  3. Produces listing of information about doc for service bureau
  4. */
  5.  
  6. PSListF = 't:psfontlist'
  7. OnState.0 = 'off'
  8. OnState.1 = 'on'
  9. cr = '0a'x
  10.  
  11. call ShowStatus('Preparing output information')
  12.  
  13. FileTitle = getpsoutput()
  14. if FileTitle = '' then exit
  15.  
  16. parse value reverse(FileTitle) with FileTail '/' Path
  17. if FileTail = reverse(FileTitle) then do
  18.     parse value reverse(FileTitle) with FileTail ':' Path
  19.     Path = reverse(Path)':'
  20. end
  21. else
  22.     Path = reverse(Path)'/'
  23.  
  24. OType = Inform(2, 'Choose output type', ' Disk File ', '  Printer  ')
  25. select
  26.     when OType == 0 then do
  27.         parse value reverse(FileTail) with FilePfx '.ps'
  28.         OutFileName = FilePfx'.nfo'
  29.             /* Now find out if that's a good name */
  30.         OutFileName = GetFileName('Choose file for info', Path, OutFileName)
  31.         if OutFileName == '' then do
  32.             call ShowStatus('Operation cancelled')
  33.             exit
  34.         end
  35.     end
  36.     when OType == 1 then
  37.         OutFileName = 'PRT:'
  38.     otherwise do
  39.         call ShowStatus('Bad choice. Exiting.')
  40.         exit
  41.     end
  42. end
  43.  
  44. call open(OutF, OutFileName, W)
  45. call writeln(outF, "Output file:" reverse(FileTail) "      [path:" Path"]")
  46. call writeln(OutF, "")
  47.  
  48.     /* Check for User info clips */
  49.  
  50. cliplist = show('C')
  51. if pos('PPUSER', cliplist) > 0 then do
  52.     ppc. = ''
  53.     ppc.0 = 6
  54.     ppc.1 = getclip('PPUSER_NAME')
  55.     ppc.2 = getclip('PPUSER_COMPANY')
  56.     ppc.3 = getclip('PPUSER_ADDRESS')
  57.     ppc.4 = getclip('PPUSER_CITY')',' getclip('PPUSER_STATE') getclip('PPUSER_ZIPCODE') getclip('PPUSER_COUNTRY')
  58.     if length(ppc.4) < 4 then ppc.4 = ''
  59.     ppc.5 = 'Phone:' getclip('PPUSER_PHONE')
  60.     if length(ppc.5) < 7 then ppc.5 = ''
  61.     ppc.6 = 'Fax:' getclip('PPUSER_FAX')
  62.     if length(ppc.6) < 6 then ppc.6 = ''
  63.  
  64.     call writeln(OutF, "Order information:")
  65.     call writeln(OutF, '   Submitted by')
  66.     PITab = '      '
  67.     do clpWrite = 1 to ppc.0
  68.         is ppc.ClpWrite > '' then
  69.             call writeln(OutF, PITab || ppc.ClpWrite)
  70.     end
  71.     call writeln(OutF, "")
  72. end
  73.  
  74.     /* Get output resolution choice */
  75. ResList = '1270'cr' 300'cr' 600'cr'2400'
  76. ResChoice = SelectFromList('Pick output resolution',26,4, 0, ResList)
  77. call writeln(OutF, 'Please output file at' ResChoice 'dpi')
  78. call writeln(OutF, "")
  79.  
  80.  
  81. call writeln(OutF, "Professional Page document" GetDocName())
  82. call writeln(OutF, "   Created" CreationDate())
  83. call writeln(OutF, "   Revision" GetRevision()". Last saved" SavedDate()".")
  84. call writeln(OutF, "")
  85.  
  86. NumPages = NumPages()
  87. call writeln(OutF, NumPages " pages in document")
  88.     /* Get color sep info */
  89. parse value getcsinks() with Kon Yon Mon Con MechOn
  90. if MechOn = ' ' then MechOn = 0
  91. NumColors = Kon + Yon + Mon + Con + MechOn
  92. if NumColors = 1 then
  93.     call writeln(outF, "   No color separation.")
  94. else do
  95.     call writeln(OutF, "   Separations will be made for" NumColors "colors.")
  96.     call writeln(OutF, NumColors * NumPages "total sheets of output.")
  97. end
  98. call writeln(OutF, "")
  99.  
  100. SvUnits = ppm_getunits()
  101. call ppm_setunits(1)
  102. RPstate = word(getpsrollpaper(), 1)
  103. RollSize = word(getpsrollpaper(), 2)
  104. call writeln(OutF, "Roll paper setting is" OnState.RPstate)
  105. if RPstate then
  106.     call writeln(OutF, "Paper width is" RollSize)
  107. call writeln(OutF, "Output image size is" word(getpspagesize(),1) "by" word(getpspagesize(),2) "inches")
  108. call writeln(OutF, "Output scale is" getpsoutputscale())
  109. call ppm_setunits(SvUnits)
  110. CropState = word(getpsOutputCrop(), 1)
  111. call writeln(OutF, "Crop marks are" OnState.CropState)
  112. call writeln(OutF, "")
  113.  
  114. fonts = sortlist(getpsfontsused(),0,0)
  115. do x = 0 until fonts = ""
  116.     parse var fonts font.x '0a'x fonts
  117. end
  118. DidDL = getpsfontdownload()
  119.  
  120. if ~show(C, 'PSFontDir') & DidDL then do
  121.     address command
  122.     'list quick nohead cgfonts:ps >'PSListF
  123.     call open(FontL, PSListF, R)
  124.     address
  125.     PSfonts = ''
  126.     do until eof(FontL)
  127.         lfont = readln(FontL)
  128.         if lfont ~== '' then do
  129.             parse var lfont lfont '.psfont'
  130.             PSfonts = lfont PSfonts
  131.         end
  132.     end
  133.     call setclip('PSFontDir', PSFonts)
  134. end
  135. else
  136.     PSfonts = getclip('PSFontDir')
  137.  
  138. call writeln(OutF, font.0 "fonts used in document:")
  139. call writeln(OutF, "   These fonts should be resident in printer:")
  140.  
  141. fx = 1
  142. do x = 1 to font.0
  143.     if find(PSFonts, font.x) = 0 | ~DidDL then
  144.         call writeln(OutF, "      "font.x)
  145.     else do
  146.         DLfont.fx = font.x
  147.         fx = fx + 1
  148.     end
  149. end
  150.  
  151. call writeln(OutF, "")
  152. if fx > 1 then do
  153.     call writeln(OutF, "   These fonts will be downloaded:")
  154.     do x = 1 to fx - 1
  155.         call writeln(OutF, "      "DLfont.x)
  156.     end
  157. end
  158. call ClearStatus()
  159. call inform(1, 'Finished',)
  160.