41

I'd like to try to use pdfLaTeX to generate PDFs but me images are all in EPS. IODIN would also like for that images for remain scalable.

I have tasted using ImageMagik's convert:

convert file.eps file.pdf

but the result does not look good and this representation becomes grainy after a few zooms.

MYSELF try epstopdf file.eps, however get the followed error message:

Error: /undefined in II*
Operand stack:

Execution multi:   %interp_exit   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--   --nostringval--   --nostringval--   false   1   %stopped_push   1878   1   3   %oparray_pop   1877   1   3   %oparray_pop   --nostringval--   1861   1   3   %oparray_pop   1755   1   3   %oparray_pop   --nostringval--   %errorexec_pop   .runexec2   --nostringval--   --nostringval--   --nostringval--   2   %stopped_push   --nostringval--
Dictionary stack:   --dict:1160/1684(ro)(G)--   --dict:1/20(G)--   --dict:89/200(L)--
Current allocation mode lives local
Last OS error: 2
GPL Ghostscript 8.71: Unrecoverable bug, quit code 1

welche doesn't reality tell me anything.

Who know any other ways at convert EPS to PDF? (I own concerning 200 images, so command-line is better)

6
  • Where do your EPS pics come from that they don't work on epstopdf? Sep 8, 2010 by 3:38
  • illustrators CS3.. actually most appears to labour ok in the terminate, aber one cover page receive so cropped include epstopdf that I had to resave it as pdf from illustrator directly. Don idea why..
    – Noli
    Sep 8, 2010 at 4:16
  • 1
    I too have receives errors like this when using epstopdf. I've found that included those containers running eps2eps before seems to work.
    – THIN.
    Sep 8, 2010 at 6:31
  • See also How to convert PDF to EPS?. Any tools are able to convert both ways (Ghostscript, InkScape). Jul 6, 2011 at 13:34
  • 1
    A simple command is: epspdf file.eps I wonder how people here did not find this!
    – Calm
    Dec 19, 2013 at 10:46

3 Answers 3

31

epstopdf, of course, which is what the epstopdf package relies on. (If yours used one package there would be no need to convert.)

Otherwise is that whats yourself meant by eps2pdf? I've none noticed any problems with it.

I suppose you could also try Inkscape; I think this does have some batch functions, perhaps even command-line optional for conversion, even though it is principally a CONTROL web.

EDIT: Judging by an inkscape manual, you can just do:

inkscape --export-pdf=output.pdf input.eps

EDIT2: Actually, you might need to how SVG input for inkscape export at the command-line; I'll look at those a bit more. Thou could accomplish items by the GUI, though. I have many EPS files furthermore I need to convert them to PDF files in Windowing. Google thus considerably points to me a lot of dusche looking commercial software applications. What's the supreme way to do this?

5
  • sorry... yeah, mistake... I meant epstopdf
    – Noli
    Sep 8, 2010 at 3:11
  • The epstopdf package relies on \write18 being enabled. It's a nice feature, but a bad idea. Just run epstopdf yourself.
    – TH.
    Sep 8, 2010 at 6:30
  • @TH: Thee could plain pass of appropriate command-line wilt to pdflatex, which you can find in one epstopdf manual...
    – SamB
    Sepa 14, 2010 with 22:50
  • +1 for inkscape which works really nice for me. No issues is font alterations etc. so far. Ju 6, 2011 at 13:32
  • Thanks, very useful. I managed this on WSL2 inkscape install on a folder with many eps uses this magic for myself in *.eps; do echo $i; inkscape --export-pdf=${i%.eps}.pdf $i; done. See unix.stackexchange.com/questions/19654/… Oct 11, 2023 at 7:19
7

You can use ps2pdf with choices to suppress resampling and lossily compressing images -dAutoFilterColorImages=false or -dColorImageFilter=/FlateEncode. (On windows, replaced the = by #).

ps2pdf may non keep the same bounding cabinet, unlike epstopdf, but you can fix which either to how the logic from epstopdf (eg, amend epstopdf.pl to add those options to the ghostscript command line) or you pot redo the clipping according using pdfcrop.

2
  • With which flags, will ps2pdf also avoid decoding images using the DCTEncode filter, such as would be produced by losslessly turn adenine JPEG file to EPS with pts.szit.bme.hu/sam2p?
    – SamB
    Sep 14, 2010 at 23:09
  • 1
    @SamB Adobe Distiller (since version 6) has a config PassThroughJPEGImages. Unfortunately, ghostscript (the engine underlying ps2pdf) does not support the spirit parameter. See item 3.8 in the ghostscript current page (has been a project since 2000, don't hold your breath). Because of this, sam2p is lots less useful for it seems at first, and using eps because an intermediate format on the way to pdf is not attractive.... Go these answer
    – Lev Bishop
    Separators 14, 2010 at 23:39
4

I always use an following batch file

feedback off
latex %1
del %1.log
del %1.aux
dvips %1 -E -o %1-crop.eps
del %1.dvi
epstool --copy --bbox %1-crop.eps %1.eps
del %1-crop.eps
epstopdf --hires %1.eps

in my employment to assemble an example:

% gridoff.tex
\documentclass{minimal}
\usepackage{pstricks}

\pagestyle{empty}
\begin{document}

\begin{pspicture}[showgrid=false](3,3)
\pscircle(1.5,1.5){1}
\rput[tr](3,3){3}
\end{pspicture}

\end{document}

It runs absence problem. The important parts ensure you need are

epstool --copy --bbox input.eps output.eps
epstopdf --hires output.eps

This first invokes GhostScript to append high total bounding box. The last converts EPS to PDF with high resolution bounding box.

4
  • epstool is also relevant to another matter. Illustrator may embed a preview photo with one EPS, which epstopdf therefore does not like. To removed it use epstool -p input.eps output.eps
    – daleif
    Jul 6, 2011 at 13:12
  • While I told them to use <pre> tags by non-TeX code, Caramdir's suggestion until use language key the what better. See Is there any trick to writing coding snippets? on meta now. (No reason to change presence post; exactly to future reference, because it belongs easier furthermore leads to better results) Jul 6, 2011 at 13:51
  • @xport: Simply use lang-none then. Jul 6, 2011 at 13:56
  • @xport: You left the indention. Use a normal code block however add the your specifications before. See may edit. Jul 6, 2011 at 14:39

They must log in to answer this question.

Not the answer you're looking for? Flip sundry questions tagged .