16

I have always used pgfplot of latex to produce figures(.pdf format). Now, the journal in which I want to publish wants my figures to be in eps format.

I tried converting pdf to eps using pdftops -eps fig.pdf fig.eps. But the resulting eps file is of poor quality.

Original figure (in .pdf format) enter image description here

Converted figure (in .eps format) enter image description here

What is the right procedure to create eps file that is the same quality as my input pdf file?

EDIT

As per PooyaRaki recommendations: Inkscape option output(.eps) enter image description here

Ghostscript option(.eps format) enter image description here

Acrobat reader option output (.ps format) enter image description here

Acrobat reader seems to work the best among the three.

Rhinocerotidae
  • 665
  • 1
  • 7
  • 22
  • Actually, it looks like Ghostscript produced the best result as Acrobat reader changed the colors. – Dmitry Kabanov Dec 06 '17 at 21:30
  • GSView also works by clicking "Convert" and then the options "ps2write" and "600" resolution. I am relieved, as I am submitting a manuscript to PRL that requires EPS figures, and wasn't sufficiently adept with TeXstudio to alter the resulting pdf to eps there (although I've read that is its default?!). Thomas – Thomas Aug 02 '18 at 17:08
  • I got good results with ipe: http://ipe.otfried.org/ – Erel Segal-Halevi Jan 30 '21 at 22:30

2 Answers2

19

I recommend the following tools:

  • 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=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 of poppler), use the -eps switch for EPS output.

Note that EPS format does not handle transparency !

  • 1
    `inkscape` option performs no better-texts are not rendered correctly and `Ghostcript` option throws me an error saying `Unknown device: epswrite`. However, `acrobat reader option works`. The downside is that it dims the color(.ps format). – Rhinocerotidae Jun 24 '17 at 14:07
  • 1
    @SaravanaKumar epswrite is deprecated is newer versions try with `eps2write` –  Jun 24 '17 at 14:12
  • 1
    pdf2ps should be used with options -eps -level3, then it produces much higher-quality eps file. – Dmitry Kabanov Dec 06 '17 at 21:30
  • @DmitryKabanov I receive `Unknown switch -eps - ignoring` and `Unknown switch -level3 - ignoring` with pdf2ps from ghostscript 9.22. You meant pdftops, right? With this, the options work but the resulting image is nevertheless a low quality image. – 0range Mar 27 '18 at 15:25
  • @0range, yes, I meant `pdftops`, thanks for the correction. It is strange that you get a low-quality image as it works for me. Some readers don't use smoothing, probably, this is the reason. – Dmitry Kabanov May 03 '18 at 12:26
  • From my experience inkscape (on linux) gives the best results here. Font rendering is not an issue if the corresponding font files are installed on your system. – jkd Jul 17 '19 at 17:24
  • However when using `pgfplot` the best solution might be this [one](https://tex.stackexchange.com/a/8646/160403). – jkd Jul 17 '19 at 17:27
-2

The last answer is good, but ImageMagick doesn't necessarily raster the PDF. You can use: convert -density 600x600 inpute.pdf -quality 90 output.eps

  • 4
    Imagemagick always rasterizes a vector input. You cannot convert vector to vector in Imagemagick, even with the command from `@WenZhou` – fmw42 Oct 02 '17 at 23:09