RSILVERMAN@EAGLE.WESLEYAN.EDU (Richard Silverman) (04/26/89)
To Jason Gross and others using the 'modlprep' Laser Prep modifications from ANNAS.WESLEYAN.EDU: Sorry! Jason pointed out an error in the part of the read.me file which describes a technique for implementing a limit on the number of pages a job can use. I have updated the file; for convenience, I have included the corrected portion below. Richard Silverman arpa: rsilverman@eagle.wesleyan.edu Computing Center bitnet: rsilverman@wesleyan Wesleyan University CIS: [72727,453] Middletown, CT 06457 -------- ADDENDA: As people ask about or suggest other uses for this scheme, I will add them to this file here. Some notes: When I say "Add code to routine 'routine'", look in PS code for text of the form /routine{ ... }bdf where the ellipsis indicates the body of the routine. Then, add the code after the body and before the closing brace. In general, when in doubt, use the example modlprep.ps file as a model for changes. IDEAS: * limiting number of copies * When you specify a number of copies in the "Copies:" item in the Print dialog, the LW driver emits code to define the name "#copies" in userdict to be that number. The PostScript operators which cause a page to be printed (showpage and copypage) check the definition of this name, and produce that many copies of each page. So, to limit the number of copies, you need only reset this variable if it exceeds your limit. To the LaserPrep routine "od" add this code (in this example, the limit is 5): userdict /#copies get 5 gt { userdict /#copies 5 put } if * limiting file size (number of pages per job) * Limiting the raw file size would be tricky; the easiest thing is to limit the number of pages. Each page produced by the LW driver begins with a call to the LaserPrep routine "op". First, use the technique shown in modlprep.ps to set a variable, say "initialpagecount" (as "trailercount" in modlprep), with the printer page count at the start of the job. Then, to the LaserPrep routine "op", add this code (in this example, the limit is 5): statusdict /pagecount get exec initialpagecount sub 5 gt { (%%[ Error: page limit exceeded ]%%) print stop } if