Search:

Summary | Source files | Compilation | Precompiled | References

EPSBB

A program for the extraction of bounding box coordinates of Encapsulated PostScript (EPS) images.

Summary of the program

The EPSBB computer program extracts the bounding box from Encapsulated PostScript (EPS) images [1]. The output is a string of coordinates of the EPS bounding box, in the format llx, lly, urx, ury, where (llx,lly) is the lower left coordinate and (urx,ury) the upper right coordinate, both given in typographic points (1pt = 1/72 inch).

This is a home-made successor of the epsbb program which in many older UNIX systems was included in the standard distribution, but evidently not in more recent variants such as Free BSD and Mac OS X. The program is essentially just a self-consistent driver/wrapper for the scan_for_boundingbox() routine that I wrote some years ago (included in the source file epsbb.c), and this is definitively one of the simplest programs I have written. I find the program very useful in scripts and Makefiles, where I occasionally want to pipe the bounding box coordinate to other programs (such as MetaPost or TeX).

Notice that I have added the -w option, compared to the classical version of EPSBB, in order to get a more readable output of the bounding box size in terms of millimetres. This option is nice to use when invoking EPSBB from the command line (in order to conform to the classical behaviour, I have though kept the default output coordinates in pt whenever the program is invoked without any options).

Current revision

Revision 1.1, as of 05/08/2004. Copyright © Fredrik Jonsson 2003-2011, under GPL

Source files

epsbb.c [9 kB] ANSI-C (ISO C90) conforming source code for the EPSBB program.
[ download | view source ]

Makefile [391 bytes] The Makefile for compilation of the executable file, and for generation of the examples, simply by executing 'make examples'. To compile the executable and documentation, simply run 'make' in the directory containing the source files and this Makefile.
[ download | view source ]

epsbb.tar.gz [4 kB] Gzip:ed tape archive of the entire EPSBB program directory, including the ANSI C source code and Makefile needed to rebuild the program and example images from scratch. [ download ]

Compilation

Compile the source code 'epsbb.c' using the enclosed Makefile, or simply by

gcc -O2 -g -Wall -pedantic -ansi ./epsbb.c -o ./epsbb -lm

Precompiled executables

epsbb [13 kB] Executable program compiled for Mac OS X 10.7 (Lion) using the GNU C Compiler (GCC). [Compiled Friday 16 Dec, 2011]

References

[1] For information on the PostScript programming language, see for example the PostScript area on the website of Adobe Systems Inc., at http://www.adobe.com/products/postscript/ or the reference book "PostScript Language - Tutorial and Cookbook" (Adison-Wesley, Reading, Massachusetts, 1985), ISBN 0-201-10179-3.

Return to previous page

Leave a message

Your name:

Your email: (required)

Message:

Generated by ::emailform::

Last modified Sunday 18 Dec 2011
QR code for string http://jonsson.eu/programs/ansic/epsbb/