Poster - a generic PS scaling program

Known restrictions:
1. It only works with one-pager.  Don't try multiple page document with this.
2. Always produce 7.5"x10" tiles with crop marks and grid # at lower right.
3. Won't best fit to use minimum number of tiles by intellegent rotation.  
   (Enhancements are welcome, make sure you debug it before sending your fix 
   to me! )
4. It treats Landscape mode page the same way as Portrait page.  The printing
   is okay, but the width/height specification and grid numbering is rotated.
   (use it on a Landscape page and look at the grid #, you'll see what I mean)
5. It uses brute force, it outputs the whole file once for each tile produced.
   If you're printing a 1/4 Megabyte PS file on 4 tiles, you are creating a
   file over one megabyte in size and takes 4 times as long to print.
6. If no BoundingBox info is found, assumes 0 0 612 792.  Will not look for
   BoundingBox info beyond the first %%EndComments line (try to prevent getting
   the wrong one from other imbedded images.)
7. Only leave 1/2" inch border.  If you need extra spacing around the image,
   you should alter the BoundingBox info yourself.
8. Works well with all my PS images.  Yours?  Good luck! :-)

Compilation:
	cc -o poster poster.c

Usage:
	poster ps-file width height [ row col ]

	ps-file is your well behaving PS program.
	width and height is the output dimension expressed in inches.
		Since the tiles are 7.5"x10", using 15 20 will usually
		produces 2x2 (4) tiles.  Depends on the aspect ratio
		of the BoundingBox, unneeded tiles will not be output.
		The program will fit the image in the area specified
		without altering the aspect ratio.  Hence using 15 10000
		means you don't care about the height.  It will create
		as many tiles as needed to fit the width.  
	row and col is the grid that you want to output.  If not specified,
	all tiles are output in the same stream.  This is useful in case
	some tiles are demaged by paper jam.  Also if your PS program is
	big and sending it out multiple times in one job is impossible,
	then you can use a loop to output the tiles in separate jobs, e.g.

		foreach i (1 2 3 4)
			foreach j (1 2 3 4)
				poster ps-file 30 40 $i $j | lpr -Pps
			end
		end

	will print all 16 tiles (30"x40" output) to the printer.

Advice:
1	print the poster only at off hours.  
2	Enough overlapping of image is produced to assist easy fitting.
3	Paste every other tiles together in a "checker-board" manner (leave
	the borders intact, only cut out the corners near the crop marks) 
	and then clip the rest of the tiles along the crop marks and then paste 
	the tiles on the "checker-board".  The borders that you left behind in 
	the previous step now provide nice backing for the rest of the tiles.
