How to convert PDF to EPS?
Providing such a tool is not the task of a TeX distribution. You need to use an external tool.
There are a couple of them which should be able to convert PDF to EPS, sometimes by going over PS first.
I can recommend the following 3 tools which produce nice results for me:
Inkscape (Vector graphic editor, free & multi-platform)
Can be either used using the GUI (open PDF, save as EPS) or using the command line (tested under Linux only):
inkscape input.pdf --export-eps=output.eps
Acrobat Reader (Linux Version) +
ps2eps
(TeXLive)acroread -toPostScript input.pdf ps2eps input.ps
Ghostscript (multi-platform)
Note:-dNOCACHE
is needed to prevent GhostScript from rastering the fonts.eps2write
was formerly used asepswrite
.gs -q -dNOCACHE -dNOPAUSE -dBATCH -dSAFER -sDEVICE=eps2write -sOutputFile=output.eps input.pdf
There are also the following tools. I didn't tested all of them and some raster the fonts :-( !
ImageMagick
convert
(which might use Ghostscript itself. Calling it manually if more flexible and might avoid issues.convert
might actually raster the PDF!)convert input.pdf output.eps
pdf2ps
(uses Ghostscript) +ps2eps
(comes with TeXLive)pdftops
(part ofpoppler
), use the-eps
switch for EPS output.
and most likely more.
Here is a Linux script pdf2eps
. It can easily be translated into a batch script for Windows.
#!/bin/sh
# $Id: pdf2eps,v 0.01 2005/10/28 00:55:46 Herbert Voss Exp $
# Convert PDF to encapsulated PostScript.
# usage:
# pdf2eps <page number> <pdf file without ext>
pdfcrop $2.pdf
pdftops -f $1 -l $1 -eps "$2-crop.pdf"
rm "$2-crop.pdf"
mv "$2-crop.eps" $2.eps
I've tried a number of options, including converting with Inkscape and using pdftops with the eps flag turned on. Both have problems with certain fonts. The online tools and ImageMagick both rasterize the image unacceptably.
I found that the most effective process is to convert in two steps: first convert the .pdf to .ps using pdftops, which preserves the fonts and doesn't rasterize the image. Next, convert the .ps to .eps using ps2eps (comes with the TeXLive distro).
A bash script I use to do this:
#!/bin/bash
# Convert PDF to encapsulated PostScript
# usage: pdf2eps <filename.pdf>
# Remove .pdf extension from input
filename=$(echo $1 | sed 's/.pdf//')
# Convert into .eps
pdftops $filename.pdf $filename-temp.ps
ps2eps $filename-temp.ps
mv $filename-temp.eps $filename.eps
rm $filename-temp.ps