[Gsview] epstool problems

Russell Lang gsview@ghostgum.com.au
Thu, 24 Oct 2002 19:42:44 +1000


Brian,

> somewhere in the documentation it is said that epstool uses the same 
> source as gsview for calculating the bbox of an eps. However, I cannot 
> make it have the same functionality :-(

That has changed a little.
epstool 2.x used the same method as GSview "Automatically 
calculate bounding box".   This rasterises the page and then 
looks for non-white pixels.  This does not give the correct 
result if the EPS file bounding box is not within an a4/letter 
page.

epstool 3 is available separately to GSview.  This uses the bbox 
in ghostscript to calculate the bounding box and is more 
accurate.

> I have a set of postscript pages extracted from a postscript document 
> with the psutils psselect utility. When in gsview I open one of these 
> files, I can do PS to EPS and get a nice tight bbox and save as eps.
> 
> However, epstool first won't let me do this. It does not accept the 
> postscript pages as eps files, just because they don't have the
> EPSF-3.0 in the first line. Adding this to the first line makes epstool 
> read and convert, but the output bbox is 0 0 0 0.

If the file doesn't have EPSF- on the first line, it probably 
isn't EPSF.  Simply adding this to the line is probably not 
sufficient.  EPSF also requires that the file have 0 or 1 pages 
only, and does not use PostScript operators with global effects.

You should tell whatever is generating the PostScript that you 
really want EPS.

I will be removing "PS to EPS" from the next version of GSview 
initially, then later I will reinstate it after adding some more 
rigorous code for checking that the file really is compatible 
with the EPS specification

> Why does this happen. Do I need to preprocess the ps-file to make it an 
> eps? Is there already a utility for this?

You could use the ghostscript epswrite device for this, making 
sure that you only convert one page.


Russell Lang                   gsview@ghostgum.com.au
Ghostgum Software Pty Ltd      http://www.ghostgum.com.au/