View previous topic :: View next topic |
Author |
Message |
Gipetto n00b
Joined: 22 Aug 2004 Posts: 12
|
Posted: Wed Jan 11, 2006 4:31 pm Post subject: Ghostscript not providing bbox info |
|
|
I'm trying to grab the bbox info from an EPS file with
Code: | gs -dBATCH -dSAFER -sDEVICE=bbox file.eps |
but nothing returns. I get the standard output that GS starts up just fine, and if I were do to a PDF conversion it works fine, but I can't get the bbox info.
Anyone have any insight into this? I've been searching high and low and can't find anything.
I have -pdflib in my make.conf - does Ghostscript by chance rely on this for bbox info? I don't see how it could.
Thanks. |
|
Back to top |
|
|
DayLung Tux's lil' helper
Joined: 13 Mar 2003 Posts: 80
|
Posted: Wed Jan 11, 2006 7:32 pm Post subject: |
|
|
does Code: | #grep BoundingBox file.ps | work? |
|
Back to top |
|
|
Gipetto n00b
Joined: 22 Aug 2004 Posts: 12
|
Posted: Wed Jan 11, 2006 7:52 pm Post subject: |
|
|
That returns
Code: | Binary file file.eps matches |
Sorry, I'm not all too familiar with grep and what it should return in that situation.
For reference I'm moving my script from an OS X laptop to the Gentoo box for further dev as it more closely matches my production machine. The script works fine with the same files on the OS X box and command line testing on the production box shows that it works with the same test file. |
|
Back to top |
|
|
DayLung Tux's lil' helper
Joined: 13 Mar 2003 Posts: 80
|
Posted: Wed Jan 11, 2006 8:01 pm Post subject: |
|
|
have you tried bbfig? |
|
Back to top |
|
|
DayLung Tux's lil' helper
Joined: 13 Mar 2003 Posts: 80
|
Posted: Wed Jan 11, 2006 8:08 pm Post subject: |
|
|
you might also try Code: | grep --binary-files=text BoundingBox file.eps |
all eps files should begin with a few lines of text like this Code: | %!PS-Adobe-3.0 EPSF-3.0
%%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software
%%Title: tree.dvi
%%Pages: 1
%%PageOrder: Ascend
%%BoundingBox: 102 92 530 710
%%EndComments
%DVIPSWebPage: (www.radicaleye.com)
%DVIPSCommandLine: dvips tree
%DVIPSParameters: dpi=600, compressed
%DVIPSSource: TeX output 2002.11.22:1213
%%BeginProcSet: texc.pro
%! |
so using grep to print the line "BoundingBox" is found on should work, and --binary-files=text forces grep to look through the file as though it were text and might fix the "Binary file file.eps matches" message |
|
Back to top |
|
|
Gipetto n00b
Joined: 22 Aug 2004 Posts: 12
|
Posted: Wed Jan 11, 2006 8:21 pm Post subject: |
|
|
Your updated grep worked - the BBox lines were shown just fine.
This is one out of 3 boxes I can have GS on and its the only one that doesn't do bbox.
I compiled GS with support for x11, cups and gtk; without support for cjk or emacs. |
|
Back to top |
|
|
Gipetto n00b
Joined: 22 Aug 2004 Posts: 12
|
Posted: Wed Jan 11, 2006 8:24 pm Post subject: |
|
|
DayLung wrote: | have you tried bbfig? |
That's a reference to a 3rd party script, right? Nothing that is in the portage tree? |
|
Back to top |
|
|
DayLung Tux's lil' helper
Joined: 13 Mar 2003 Posts: 80
|
Posted: Wed Jan 11, 2006 8:42 pm Post subject: |
|
|
Gipetto wrote: | DayLung wrote: | have you tried bbfig? |
That's a reference to a 3rd party script, right? Nothing that is in the portage tree? |
that's right, it's used mostly with tex, if your interested it can be found here, though I've never really used it much. |
|
Back to top |
|
|
Gipetto n00b
Joined: 22 Aug 2004 Posts: 12
|
Posted: Wed Jan 11, 2006 8:43 pm Post subject: |
|
|
I'll check it out but would really just like GS to work correctly... sometimes I think I'm asking too much.
But, now that I think of it, the functionality of GS providing the BBox lines is exactly the same as the grep you gave me... and its faster than GS to boot. I could just use that. I really don't anticipate any EPS files not having BBox entries as everything will be coming from graphic designers running Illustrator or Freehand or exporting from a layout program - so everything should have a bbox. |
|
Back to top |
|
|
Gipetto n00b
Joined: 22 Aug 2004 Posts: 12
|
Posted: Wed Jan 11, 2006 9:15 pm Post subject: |
|
|
Now I find that -dEPSCrop isn't working either. Is there some special config of Ghostscript that I need to be aware of before or after emerging it? |
|
Back to top |
|
|
|