home *** CD-ROM | disk | FTP | other *** search
/ DTP Toolbox / DTPToolbox.iso / propage4.0 / arexx / printtolaserjetusingpost.pprx < prev    next >
Encoding:
Text File  |  1994-10-10  |  3.3 KB  |  76 lines

  1. /* This genie uses the public domain Postscript interpreter "Post" to print your document. The advantages are that you can print .eps files on a non-Postscript printer and that you can use real Type 1 fonts, rather than converted versions.  The files "post" and "init.ps" should be in a drawer called "post" in your "PPage:" drawer (if not, modify the indicated line in the genie), the necessary .psfont files in CGFonts:ps, and "post.library" in libs:  You do NOT need "Conman". 
  2. Make sure the assigns for PPage: and CGFonts: are set up in your startup-sequence or user-startup files. 
  3. It is also essential to set the Limits in your printer graphics preferences to the correct page size in pixels i.e. the printer's dots-per-inch * page size in inches. Typical figures are 1500 by 2100. */
  4.  
  5. trace n
  6. signal on error
  7. signal on syntax
  8. address command
  9. call SafeEndEdit.rexx()
  10. call ppm_AutoUpdate(0)
  11. cr="0a"x
  12.  
  13. oldoutput = ppm_GetPSOutput()
  14. call ppm_SetPSOutput("PPage:temp.ps")
  15. call ppm_SetPSFontDownload(0)
  16. success = ppm_PrintDocPS(1,1)
  17. if success ~=1 then exit_msg("Failed saving temporary Postscript file.")
  18.  
  19. form = "Page size (0-7):3"cr"Portr./landsc. (P/L):P"cr"Start page:all"cr"End page:all"cr"Number of copies:1"cr"Compress on/off(1/0):1"cr"Destination:par"
  20.  
  21. form = ppm_GetForm("Printing setup...",7,form)
  22. if form = "" then exit_msg("Aborted by user")
  23. parse var form size "0a"x portrait "0a"x startpage "0a"x endpage "0a"x copies "0a"x compression "0a"x destination
  24. size = left(size,1)
  25. if verify(size,"01234567")~=0 then size = 3
  26. portrait = upper(left(portrait,1))
  27. if portrait = "L" then portrait = 1
  28. else portrait = 0
  29. if datatype(startpage,"N")=0 then startpage = 0
  30. if datatype(endpage,"N")=0 then endpage = 0
  31.  
  32. if datatype(copies,"N")=0 then copies = 1
  33. if left(compression,1)~="0" then compression = 1
  34. destination = strip(destination,"T",":")
  35. if destination~="par" & destination~="ser" then do
  36.     destination = ppm_GetFileName("Set output file...","ram:","postljtest")
  37.     destination = '"'destination'"' /* So you can have spaces in file name */
  38.     end
  39. if destination = "ser" | destination = "par" then destination = destination":"
  40.  
  41. options = " -s"size" -a"portrait" -b"startpage" -e"endpage" -c"copies" -g"compression
  42. postcommand =  "postlj "options" init.ps PPage:temp.ps TO "destination
  43.  
  44. /* Set up a text file in ram: and then send it to a temporary command window */
  45. conwindow = "CON:40/40/500/200/NewWindow"
  46. call open out, "ram:temp", write  /* This wipes out any existing ram:temp  */
  47. call writeln out, "cd PPage:Post" /* post is in drawer "Post" in "PPage:" - if not, change this line  */
  48. call writeln(out, postcommand) /* To use lots of fonts in one document, add memory to Post here. See Post documentation. */
  49. call writeln out, "delete PPage:temp.ps"
  50. call writeln out, "endcli"  /* if you have problems, comment this line out so the CLI stays on screen with Post error mesages */
  51. call close out
  52. "newcli" conwindow "ram:temp" /* open a CLI and use ram:temp as a set of commands */
  53.  
  54. call ppm_SetPSOutput(oldoutput)
  55. call exit_msg()
  56.  
  57. end
  58.  
  59. error:
  60. syntax:
  61.     do
  62.     exit_msg("Genie failed due to error: "errortext(rc))
  63.     end
  64.  
  65. exit_msg:
  66.     do
  67.     parse arg message
  68.     if message ~= "" then
  69.     call ppm_Inform(1,message)
  70.     call ppm_ClearStatus()
  71.     call ppm_PPageToFront()
  72.     call ppm_AutoUpdate(1)
  73.     exit
  74.     end
  75.  
  76.