Take the 2-minute tour ×
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: The way I see it, is that can't belongs to find a converter while neither belongs to MikTeX nor TeXLive and not to can or can't find. –  Martin Scharrer Jun 16 '11 at 14:33
    
@Peter: I see, but also note that people there point out that the original sentence doesn't sound natural (comment of Unreason) and can be confusing (Martha's answer). So I would suggest to write "I can't find a converter to convert PDF to EPS either in MikTeX or TeXLive" (as suggested in the TeX.SX thread). Also "converter to convert" doesn't sound good. Anyway, instead of starting a lengthly discussion here, just change the text back. Edits from the moderators are not carved in stone or in any way binding. –  Martin Scharrer Jun 16 '11 at 15:26
2  
@Martin We are in violent agreement! –  Peter K. Jun 16 '11 at 17:47
    
@Alan: Thanks! I fully agree with the "can't" and the comma. The original "can" version is just too confusing. –  Martin Scharrer Jun 23 '11 at 16:09
add comment

8 Answers

up vote 25 down vote accepted

Here is a Linux script pdf2eps, 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
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
1  
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
add comment

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
1  
@xport: I now figure out that Inkscape allows for command line arguments to directly convert formats. I added the command. It runs under Windows, Mac and Linux! –  Martin Scharrer Jun 24 '11 at 16:29
1  
@xport: I found out that inkscape support command line arguments for conversion. It produces nice results! It is also able to produce SVG which are nice for online content. –  Martin Scharrer Jul 5 '11 at 17:23
1  
+1 for the reference to Inkscape which produced the best results for me in Windows. –  dafmetal May 3 '12 at 9:07
show 5 more comments

I'm not really experiensed in scripts, so I did it "manually".

  1. Open pdf in inkscape
  2. Rasterize the file (Ctrl+Shift+E or File -> Rasterize). This option can export to *.png only but after you get png-file you can easely convert it to eps or any picture file type. The options of picture resolution and picture size are available.

I know that this way is not optimal and probably don't suit any case, but it took less time than to learn how to use the scripts mentioned above and to test them.

P.S. BTW, most online pdf-to-eps tools works ugly.

share|improve this answer
    
"not optimal" is a nice expression, when you smash vector graphics to bitmaps. –  math Apr 9 at 7:56
add comment

Unfortunately, the EPS format does not handle transparency. If the PDF source file includes transparency, then the tools listed above will rasterize the image in the EPS output, leading to pixelation and larger file sizes. One possible solution is to use an EPS file with non-standard extensions (link).

Conversion from PDF to EPS can be achieved without pixelation using the Adobe Acrobat software. I selected Save As..., and then Format -> Encapsulated Postscript. Under Settings... I have noticed that the General -> Binary option slightly reduces file size. On OS X, I find that Color Management -> Color Profile -> Apple RGB preserves screen display colors. The output EPS file is larger than the PDF source, but otherwise looks the same to me.

share|improve this answer
add comment

pdftops sometimes messes up the bounding box. I use Adobe Illustrator to get the job done. The file size is usually 5 times larger.

I know it is a heavy and expensive tool for a simple job, but if you do have it already, why not use it. :)

share|improve this answer
add comment

Copied from http://www.iml.ece.mcgill.ca/~stephan/oopdf2eps

It worked very well

#!/bin/bash

TARGET=${1%.pdf}.eps
echo "pdftops -eps ${1} - | ps2eps > ${TARGET}"
pdftops -eps ${1} - | ps2eps > ${TARGET}
echo "ps2eps stdout redirected to: ${TARGET}"
share|improve this answer
    
Welcome to TeX.SX! –  Claudio Fiandrino Nov 7 '13 at 20:30
add comment

On Windows (with gsview installed) I do the following:

  1. Open file.pdf in gsview.
  2. File/Select/Convert and choose 'epswrite' as your Device.
  3. Pat yourself on the back.
share|improve this answer
add comment

Most solutions rasterize the PDF-file resulting in large files. In my case, inkscape failed because some characters are missing (ligatures like ff, fl). Acroread worked in one case, the other failed because of a wrong bounding box.

My solution was, to use the document viewer (Ubuntu 13.10) and to print the document into a file with the Postscript-option (the resulting file is vector based). The postscript file could be converted with ps2eps.

share|improve this answer
add comment

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.