[Thread Prev][Thread Next][Index]

Re: [ferret_users] [Ferret] white space remains when converting .epsifile to pdf



Hi Zhen,

How did you convert from eps to pdf? If you use "epstopdf" you should not have a problem. This is an automatic way to get around the manual editions proposed by Jaison.

As an example, see the Bourne shell script below that takes one or more ferret .plt files and automatically makes some clean files (including pdf) without the white border. I have often embedded the resulting pdf files in LaTeX documents using pdflatex and have had no problem with resulting white margins around figures.

#!/bin/sh
#
# plt2all: Converts plt file to eps, pdf, and png files
#
# Usage: plt2all file1.plt file2.plt ...
# ------
# J. Orr, LSCE/CEA 25 July 2002
#
for file in $*
do
stem=`echo $file | sed s:\.plt::`
# echo "Input, Output files:" $file "," $stem
echo " "
echo "Making from $file:"
echo "---------------------------------------"
gksm2ps -p portrait -l cps -d cps -R -o $stem.ps $file
echo "1) $stem.ps (Postscript)"
ps2epsi $stem.ps
mv $stem.epsi $stem.eps
echo "2) $stem.eps (Encapsulated Postscript)"
epstopdf $stem.eps
echo "3) $stem.pdf (Adobe PDF)"
convert $stem.eps $stem.png
echo "4) $stem.png (PNG)"
echo "---------------------------------------"
done

exit 0



On Thu, 26 Oct 2006, Jaison Kurian wrote:

Hi Zhen,
        Open your ps file in "gv" (ghost view), place the cursor
on the figure corners..then you will see some numbers in the 3rd
small box on the left column. Then open the ps file in a text editor
(like emacs or vim), on the 5th line you can see something like this
"BoundingBox:  18 22 593 770". Now according to the numerical values
appearing in the small box in gv, correct the entries in ps file
against this "bounding box".....then use ps2epsi to get eps and
epstopdf to get a pdf.....

Rules for editing bounding box :

  1. Leftern edge of the page corresponds to  x=0
  2. bottom  edge of the page corresponds to  y=0
  3. GV displays numerical values in the format "X x Y"
  4. Bounding Box entries are in the order
          X_left, Y_bottom, X_right, Y_top

Basically you can get X_left and Y_bottom by placing the cursor
at the bottom-left corner of the plot and X_right & Y_top by
placing the cursor at the top-right corner of the plot (here plot
means the area without the white space).

Let me know if you have any difficulties,

Regards,

Jaison


On Thu, 26 Oct 2006 zhen.li@gsfc.nasa.gov wrote:

Hi Ferret users:

I used the "ps2epsi" command to convert ferret-produced ps file to
eps file, so that the
a proper bounding box is assigned to the figures, and the white
spaces at the edge of the
figures are eliminated. However, when I convert the eps file to pdf
file, incorporate these
figures into the LaTeX document, and then use command "pdflatex" to
create a document,
the white space remains.

Does anyone know how to solve this problem?

Thank you for your attention!

Zhen




--
James Orr
Marine Environment Laboratories (MEL-IAEA)
4, Quai Antonie 1er
MC-98000 Monaco

Tel:  +377 9797 7229
Fax: +377 9797 7273
Email: j.orr@iaea.org

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement