Tell me more ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I can't find a tool to convert PDF to EPS, neither in MikTeX nor in TeXLive. Is there such a tool actually?


Update:

Based on Herbert's accepted answer, I simplify his batch as follows:

#!/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" "$2-temp.pdf"
pdftops -f $1 -l $1 -eps "$2-temp.pdf" "$2.eps"
rm  "$2-temp.pdf"

For Windows users, create a batch file, name it pdf2eps.bat as follows:

rem pdf2eps <page number> <pdf file without ext>
echo off
pdfcrop "%2.pdf" "%2-temp.pdf"
pdftops -f %1 -l %1 -eps "%2-temp.pdf" "%2.eps"
del  "%2-temp.pdf"
share|improve this question
@xport: "I can find a converter to convert PDF to EPS neither in MikTeX nor TeXLive" didn't make much sense, so I though you forget the 't after can. I also just saw that "Is there this tool actually?" isn't correct either. Would be better phrased as "Is there such a tool?" or "Does such a tool exist?", wouldn't it? I'm not a English native speaker myself. – Martin Scharrer Jun 16 '11 at 13:51
2  
@Martin: I think you're wrong. As expressed in your edit, the sentence is a double negative. – Peter K. Jun 16 '11 at 15:09
1  
@Martin We are in violent agreement! – Peter K. Jun 16 '11 at 17:47
3  
@xport Sorry to bring this up again, but your last edit made things worse. Despite the advice you received on english.sx, the correction made by Martin was more or less correct in this case. I don't want to pull rank here, but I am a linguist who specialises in syntax (and a native English speaker). Trust me, the version that I have corrected is correct, and expresses what you want the question to mean. – Alan Munn Jun 16 '11 at 23:49
1  
@Jasper, the comma certainly is required in this sentence. Without the comma, and with 'can' then the issue of the non-idiomatic nature of the sentence arises again. (So basically I agree, except the one with 'can' is really not very good.) – Alan Munn Jun 17 '11 at 11:15
show 3 more comments

2 Answers

up vote 14 down vote accepted

Here is a Linux script pdf2eps, can easily be traslated into a batch script

#!/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
share|improve this answer
I see. I forget to include the --gscmd gswin64c because I have 2 ghostscript installed. – xport Jun 16 '11 at 9:45
2  
To make sure that the script works with arguments that include a space I'd recommend to put all references for $1 and $2 in double quotes, like so: "$2.pdf". – Christian Lindig Jun 24 '11 at 16:34
no, spaces in filenames should not be supported ... – Herbert Jun 28 '11 at 17:36
If any of the commands fails, the script will continue, while it shouldn't. Put set -e in the beginning. – Andrey Vihrov Jul 10 '11 at 13:05

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.

    gs -q -dNOCACHE -dNOPAUSE -dBATCH -dSAFER -sDEVICE=epswrite -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 of poppler), use the -eps switch for EPS output.

and most likely more.

share|improve this answer
@xport: See my update, simple use the pdf2ps wrapper script. – Martin Scharrer Jun 16 '11 at 7:40
2  
Of these options, I recommend pdftops, using the format pdftops -level3 -eps file.pdf file.eps. The result isn't quite strictly EPS for some reason though. I pipe through sed '2s/^/%/' to force the proper double % comment format for the second line (most tools do not care about this, but some might). – Lev Bishop Jun 16 '11 at 15:44
@xport: Thanks, I accidentally put this to pdf2ps while it belongs to pdftops. – Martin Scharrer Jun 23 '11 at 15:52
@Martin: So how can pdf2ps produce eps? – xport Jun 23 '11 at 15:58
@xport: I added a Ghostscript command now. You could copy pdf2ps to pdf2eps which is a shell script and replace the output device ps2write to epswrite. It's basically the same as the command above just with a nicer interface. – Martin Scharrer Jun 23 '11 at 16:02
show 5 more comments

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.