Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

obtain current position for BoundingBox

30 views
Skip to first unread message

Daniel...@adobeforums.com

unread,
Mar 13, 2009, 7:34:09 AM3/13/09
to
Hi,
the bbox device of ghostscript is said to be incorrect (by the manual of ps2eps - Linux), and I also experience this: it prints incorrect bounding boxes. So I would like to implement an automatic method to obtain the correct bounding box, by
1) making a block in the postscript file that I generate, like this:
/CalculateBBox where {
lower_left_x lower_left_y moveto
currentpoint = =
upper_right_x upper_right_y moveto
currentpoint = = } if
2) running gs by defining CalculateBBox: gs -dCalculateBBox myfile.ps;
and grepping the numbers from the output

The problem is, that currentpoint seems to return the current position in a local coordinate system (for example if my eps file is included in a latex document, and I want to obtain the bounding box of this final document, it fails).
Does anybody know how to do this?

Thanks

Helge Blischke

unread,
Mar 14, 2009, 10:11:07 AM3/14/09
to
Daniel...@adobeforums.com wrote:

bracket your BBox computaions with

gsave
matrix defaultmatrix setmatrix
% your stuff here
grestore

in order to get your coordinates in the default coordinate system.

Helge

0 new messages