[comp.lang.postscript] computing a bounding box?

news@root.fiu.edu (06/02/90)

We have a program which takes the screendump of a workstation
and makes from it a postscript file.  We have a set of latex
macros which read in this postscript file and integrate it 
into a latex document.  The problem is that these macros expect
to see a comment at the front specifying the bounding box and
the screendump software does not do this.  Is there any easy
way of computing the bounding box and inserting this comment?

cosell@bbn.com (Bernie Cosell) (06/04/90)

news@root.fiu.edu writes:

}We have a program which takes the screendump of a workstation
}and makes from it a postscript file.  We have a set of latex
}macros which read in this postscript file and integrate it 
}into a latex document.  The problem is that these macros expect
}to see a comment at the front specifying the bounding box and
}the screendump software does not do this.  Is there any easy
}way of computing the bounding box and inserting this comment?

The answer is "yes and no".  There is a program available called
'bbfig' by Ned Batchelder.  It does pretty well, and if you're lucky
it'll be able to eat your particular PostScript and you'll be home
free.  It is small enough to be easily email'able, and I don't exactly
remember where it is archived [several places, actually].  That's the
'yes' part.  The 'no' part is that it isn't so perfect around the
edges.  There are a few bugs and not-so-goods in it, and in particular
it will not cope at all with a few constructs that the Mac's LaserPrep
is fond of using, and so there is a whole range of Mac stuff that it
won't handle properly.  I'm busily hacking away trying to puzzle out
what the h*ll LaserPrep is doing [*anyone* have a _commented_ version
of it?  I'm piecing together what it is up to, but it is REAL
hard...:-(], and I"m hoping that maybe next week I'll be able to post a
a close-to-bulletproof version.

  /Bernie\