This package is a PostScript prolog which when used with almost any valid PostScript will output it with multiple logical pages on each physical page. Each logical page will be identical (but smaller) to the original result of each showpage. Written By: Ross Cartlidge University Computing Service Building H08, Sydney University NSW, 2006, Australia rossc@extro.ucc.su.oz Email +61 2 692 3495 Phone +61 2 660 6557 Fax It works by overlaying each PostScript Operator which is affected by or affects the absolute graphics state with a procedure which first goes back to normal full page graphics state, does the operator, and then restores the multiple page graphics state. Thus when "initgraphics", eg, is executed its transformation of CTM, path and clippath is mapped onto the multiple page representation. Also when a "save" is done the full page version is saved, thus when "restore" is done - possibly many logical pages into the future - the graphics state saved is transformed into the new multi page. All its local variables are stored in private (unnamed) directories and the only "pollution" of the current directory is with the entry and exit points "multi" and "endmulti". It is written to be able to be included in the "exitserver" state of the the server, thus it can be loaded before any other permanent prologs which may use absolute graphics commands (like "showpage"). It works recursively so a "multi" can be called inside another "multi" to any level (VM permitting). It tries to use as little VM as possible but some is consumed in restoring paths between multi and single page graphics states so large documents may cause VMerror earlier than in normal representation unless "save-restore" is used appropriately. USAGE: "multi.ps" defines 2 procedures:- (i) landscape nrows ncols dividers multi - Go into multi page representation landscape boolean, if true divide page in landscape orientation nrows integer, number of logical pages down physical page ncols integer, number of logical pages across physical page dividers boolean, if true divide logical pages by lines (ii) endmulti - End multi page representation EXAMPLES: Display pages in "side by side" form % landscape mode, 1 row, 2 cols, dividers true 1 2 true multi % /Helvetica findfont 12 scalefont setfont 100 100 moveto save (This is Page One) show showpage restore save (This is Page Two) show showpage restore % endmulti To run this example type:- sh eg.sh | It's not a bad idea to load multi.ps in to the "exitserver" state of your LaserWriter as then it will work with any prologs you may be using. Make sure you load it first! To load it into the "exitserver" state see the comments at the start of multi.ps. You then only need the :- true 1 2 false multi line in code sent to the LaserWriter. CAVEATS: If you have a proprietary font in you path or your clippath then the path will be lost when one of the overlayed operators is used. If you need the font in the path then either stop the overloading of that operator and assume its effect won't be used across logical page boundaries or change the postscript you are "multi-ing" to refer to the systemdict version of the operators where the effect is not used across page boundaries. EG: CHANGE (FRED true charpath gsave fill grestore stroke TO (FRED) true charpath systemdict begin gsave end fill systemdict begin grestore end stroke OR remove the overloading of gsave/grestore from multi.ps More memory is consumed than normal output Direct references to operators through "systemdict" will circumvent overlays Programs which rely on the overlayed named being operators and not procedures will fail. For example:- /showpage { showpage } bind def will create an infinite loop when showpage is called. Also procedures directly on the stack do not execute unlike operators so the program:- /s [ /showpage load ] cvx def s will not work ( an "exec" is required after the "load") Device changing operators such as "letter", etc are mapped to null procedures