psfixbb - fix the BoundingBox in a Postscript file.
psfixbb [-ceflr] [-x N] [-o outfile] filename [filename...]
psfixbb is a tool to create a BoundingBox in
which do not have one, or to fix an incorrect existing BoundingBox.
Many applications write
Postscript(R) files or Encapsulated
Postscript(R) files with no or incorrect BoundingBox information.
I.e. the box which contains the image or text on the page is often
smaller than specified in the %%BoundingBox comment in the file. This
can be annoying when importing the file into other documents.
psfixbb computes the size of the used part of a page and inserts
the information into the file.
psfixbb uses ghostscript (gs) to transform the page into a portable bit map (pbm), then the pnmfile and pnmcrop utilities to determine the size of the non-white part of the page. These three programs need to be installed for psfixbb to work.
Because psfixbb really looks at the dark pixels of the page, it works even if the application which produced the Postscript file has painted the backgroud of the whole page white. Most other boundingbox-fixing utilities fail in such cases.
For landscape files you need to run psfixbb with the -r switch.
Carsten Dominik <dominik@strw.LeidenUniv.nl>
Holger Karl <firstname.lastname@example.org>
This program is free software. See the source file for the full copyright notice.
For the file file.ps, file.ps% is used temporarily to hold a new version of the file with changed BoundingBox.
gs(1), pnmfile(1), pnmcrop(1),
psfixbb does not work for images larger than a normal page.
The file file.ps% is overwritten without checking. For multipage documents, only the first page determines the value of the BoundingBox.
Thanks to Georg Drenkhahn for pointing out how to enforce a showpage command in gs.