From charlesreid1

No edit summary
No edit summary
 
(One intermediate revision by the same user not shown)
Line 31: Line 31:
done
done
# end of script.
# end of script.
</bash>
</source>


Usage: pdf2eps *.pdf
Usage: pdf2eps *.pdf
Line 38: Line 38:


* http://email.esm.psu.edu/pipermail/macosx-tex/2004-July/006767.html
* http://email.esm.psu.edu/pipermail/macosx-tex/2004-July/006767.html
[[Category:Latex]]
[[Category:Programs]]

Latest revision as of 15:19, 8 August 2011

The Problem

EPS files are common and easy to use in LaTeX documents, but they're only easy to produce if you have direct control over the production process, which is often not the case.

PDF files are common and easy to generate, and sometimes someone gives you a PDF file and you need to incorporate it somehow. But they aren't easy to convert to EPS.

The Solution

The solution is, use Ghostscript:

gs -dNOPAUSE -dNOCACHE -dBATCH -sDEVICE=epswrite -sOutputFile=your-output-file.eps your-source-file.pdf

or, you can put it in a script and name it pdf2eps and put it on your path:

#!/bin/bash
while test $# -gt 0 ;
do
     case $1 in
	*.pdf)
	    /usr/local/bin/gs -dNOPAUSE -dNOCACHE -dBATCH -sDEVICE=epswrite 
-sOutputFile=${1%.pdf}.eps $1
	    ;;
	*)
	    echo "File $1 not recognised, skipping"
	    ;;
	esac
     shift
done
# end of script.

Usage: pdf2eps *.pdf

References