PSFIXBB - fixing the BoundingBox in postscript files
PSFIXBB computes the BoundingBox of a postscript file and sets the %%BoundingBox comment in the file accordingly. The hard work is actually done by ghostscript, pnmfile and pnmcrop - these programs must be installed on the system.
PSFIXBB is written in Perl and requires version 5.003 or higher. You can have a look at the PSFIXBB man page or grab the complete PSFIXBB program (which contains the man page in POD format).