[OS X TeX] epstopdf

Piet van Oostrum piet at cs.uu.nl
Thu Sep 29 00:12:23 CEST 2005


>>>>> Chris Goedde <cgoedde at condor.depaul.edu> (CG) wrote:

>CG> A couple weeks ago, Luis Sequeira wrote:
>>> Like a previous poster has said, it is better to handle (b) at shell
>>> level.
>>> To convert all eps files below a given directory, you may do the
>>> following:
>>> 1) Open Terminal and cd to the appropriate directory
>>> 2) type the following command:
>>> find . -name '*.eps' -exec epstopdf {} \;

>CG> This  fails for me if the path contains spaces, which all my (relevant)
>CG> paths do. From the command line, I've tried every combination I can think
>CG> of: escaping the spaces with \, and using single and double quotes around
>CG> the path. But epstopdf always chokes. (It might be gs that is actually
>CG> choking.) Is it really impossible to use epstopdf to batch convert eps to
>CG> pdf when the path names contain spaces? I think I can work around this (by
>CG> using cd), but I'm curious if I really have to.

A simple change in epstopdf can cure this:

Replace the lines:

  my $pipe = "$GS -q -sDEVICE=pdfwrite $GSOPTS -dAutoRotatePages=/None" .
          " -sOutputFile=$OutputFilename - -c quit";
with:

  $OutputFilename =~ s/'/'"'"'/g;
  my $pipe = "$GS -q -sDEVICE=pdfwrite $GSOPTS -dAutoRotatePages=/None" .
          " -sOutputFile='$OutputFilename' - -c quit";

-- 
Piet van Oostrum <piet at cs.uu.nl>
URL: http://www.cs.uu.nl/~piet [PGP 8DAE142BE17999C4]
Private email: piet at vanoostrum.org
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list