[Thread Prev][Thread Next][Index]

Re: converting metafile to EPS



Hi Hein,

To do what you ask I used the attached shell script.
In unix, you would just do 

  plt2all filename*.plt

and the script creates .ps, .eps, .pdf, and .png output files for
each .plt input file.  The resulting .eps, .pdf, and .png files are
also clipped correctly (all bordering white space removed).

Regards,

Jim

On Wed, 13 Apr 2005, Hein Zelle wrote:

> Dear Ferret users,
> 
> does anyone know of a working method to convert a ferret metafile to
> an EPS file with a properly cropped boundingbox? I generate the
> postscript file with "Fprint -l cps -o postscript.ps metafile.plt". In
> the past I have succesfully used
> 
> - psfixbb 
> - convert postscript.ps postscript.eps
> - ps2epsi postscript.ps postscript.epsi
> 
> I am now using ferret 5.8. On this system (debian unstable) I don't
> have psfixbb. Convert crops the figure around the axis (axis labels,
> title and colorbar labels fall off). ps2epsi puts the figure on a full
> a4 page instead of cropping it.
> 
> Does anyone know of a tool that succesfully crops postscript files
> generated by ferret 5.8 and Fprint (gksm2ps) and makes a proper EPS
> file? I'll happily write a script to modify the postscript file too,
> but I don't know what to modify.
> 
> Thanks
> 	Hein Zelle
> 
> >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-< 
>  Unix is user friendly. It's just very particular about who 
>  it's friends are.
> 
>  Hein Zelle                     hein@icce.rug.nl
> 	                        http://www.icce.rug.nl/~hein
> >-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-<
> 

-- 
======================================================================
   James Orr                      
   Laboratoire des Sciences du Climat et de l'Environnement
   Unite Mixte de Recherche CEA-CNRS

   LSCE, CEA Saclay                http://www.ipsl.jussieu.fr/~jomce
   Bat. 701 - Orme                 mailto:  orr@cea.fr
   F-91191 Gif-sur-Yvette Cedex    Phone:   (33) (0)1 69 08 77 23
   FRANCE                          Fax:     (33) (0)1 69 08 77 16
======================================================================
#!/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

[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement