NAME

psfixbb - fix the BoundingBox in a Postscript file.


SYNOPSIS

psfixbb [-ceflr] [-x N] [-o outfile] filename [filename...]


DESCRIPTION

psfixbb is a tool to create a BoundingBox in Postscript(R) files 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.


OPTIONS

-c
Send a new file with the correct BoundingBox to stdout. This will leave the original file untouched. Only the first filename on the command line will be processed.

-e
When the filename extension is .ps, change it to .eps (unless the resulting file name corresponds to an existing file). See also the -f flag.

-f
When specified together with the -e flag, existing .eps files are overwritten when necessary.

-l
List computed BoundingBoxes, do not change any files.

-o outfile
Output to file OUTFILE.

-r
Rotate the postscript file before attempting to compute the bounding box. Needed for landscape files.

-x N
The BoundingBox created can be made larger than the actual image by N postscript points with this option.


AUTHOR

Carsten Dominik <dominik@strw.LeidenUniv.nl>

Holger Karl <karl@informatik.hu-berlin.de>

This program is free software. See the source file for the full copyright notice.


FILES

For the file file.ps, file.ps% is used temporarily to hold a new version of the file with changed BoundingBox.


SEE ALSO

gs(1), pnmfile(1), pnmcrop(1), pnm(5)


BUGS

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.


ACKNOWLEDGMENTS

Thanks to Georg Drenkhahn for pointing out how to enforce a showpage command in gs.