Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.postscript > #650

Re: Setting %%BoundingBox from postscript variables

From helbig@astro.multiCLOTHESvax.de (Phillip Helbig---undress to reply)
Newsgroups comp.lang.postscript
Subject Re: Setting %%BoundingBox from postscript variables
Date 2012-04-02 21:09 +0000
Organization Multivax C&R
Message-ID <jld4hn$p8j$1@online.de> (permalink)
References <ac527258-785b-4f06-bb50-4a5e8a7971d7@k6g2000vbz.googlegroups.com> <914d544b-f190-44ec-8672-aed21223d839@s27g2000yqd.googlegroups.com>

Show all headers | View raw


In article
<914d544b-f190-44ec-8672-aed21223d839@s27g2000yqd.googlegroups.com>,
luser- -droog <mijoryx@yahoo.com> writes: 

> > I wrote a small PS code that generates a skeleton of cardboard box. I
> > set some basic parameters (height, width etc) at the start of the PS
> > file and all lines are calculated and drawn.
> >
> > Once the parameters are set, I can easily calculate the size of the
> > page needed, but I can't find a way to inject this value to the %
> > %BoundingBox directive.
> >
> > In other words, is there a way to insert PS variables into the
> > comments?
> >
> > Thanks
> 
> Not directly. Because the variables don't exist until the program is
> running; at which point there's no longer a complete "file" available
> (merely a partially-consumed filetype object).
> 
> The simplest way is use the ghostscript -sDEVICE=bbox .
> 
> From vi, position the cursor on a blank line and
> 
>     !!gs -q -sDEVICE=bbox -dBATCH -dNOPAUSE %
> 
> should insert the `gs`-computed BBox and Hi-ResBBox into the file.

I have a similar problem: a Fortran program which does everything I need 
(for making nice plots) except producing a valid bounding box.  There is 
a bounding box in the output file but it is approximate since the exact 
value changes with the heights of symbols etc.  So, I could just produce 
such a plot, run the gs command above and it will insert the proper 
bounding box into the file?

Back to comp.lang.postscript | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Setting %%BoundingBox from postscript variables Snark <gadior@gmail.com> - 2012-03-31 13:40 -0700
  Re: Setting %%BoundingBox from postscript variables luser- -droog <mijoryx@yahoo.com> - 2012-04-01 01:53 -0700
    Re: Setting %%BoundingBox from postscript variables helbig@astro.multiCLOTHESvax.de (Phillip Helbig---undress to reply) - 2012-04-02 21:09 +0000
      Re: Setting %%BoundingBox from postscript variables luser- -droog <mijoryx@yahoo.com> - 2012-04-05 10:55 -0700

csiph-web