Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

epstopdf problem

438 views
Skip to first unread message

Richard Sperling

unread,
Sep 8, 2001, 1:50:07 PM9/8/01
to
I'm new to pdflatex and epstopdf and I'm having a little trouble. I
use MikTeX 2.1 and WinEDT on Windows 2000. There are \includegraphics
declarations in my .tex document. The graphics are eps files named
fig1.eps, fig2.eps, and fig3.eps (original, I know). I'm trying to
use epstopdf to do the graphics conversion. In the preamble I have:

\usepackage[pdftex]{graphicx}
\usepackage{epstopdf}

When I try to compile the .tex file using pdflatex I get the following
sequence of errors:

Error: May not be a PDF file (continuing anyway)
Error (0): PDF file is damaged - attempting to reconstruct xref
table...
Error: Couldn't find trailer dictionary
Error: Couldn't find xref table

Error: pdflatex (file fig1.pdf): xpdf: reading PDF image failed

pdflatex converts fig1 ok, but that's it. I'm obviously missing
something, but I don't know what it is. Would someone please provide
some assistance or point me to the relevant documentation. Thanks very
much.

Richard

Herman Bruyninckx

unread,
Sep 8, 2001, 4:42:03 PM9/8/01
to Richard Sperling
On Sat, 8 Sep 2001, Richard Sperling wrote:

> I'm new to pdflatex and epstopdf and I'm having a little trouble. I
> use MikTeX 2.1 and WinEDT on Windows 2000. There are \includegraphics
> declarations in my .tex document. The graphics are eps files named
> fig1.eps, fig2.eps, and fig3.eps (original, I know). I'm trying to
> use epstopdf to do the graphics conversion. In the preamble I have:
>
> \usepackage[pdftex]{graphicx}
> \usepackage{epstopdf}

epstopdf is a _program_ not a package :-)
Use it to convert your .eps files to .pdf files, before pdflatex-ing
them. Don't use file extensions in the \includegraphics:

\includegraphics{myfile}

will use myfile.eps when you convert to PostScript, and myfile.pdf
when you use pdflatex to get a PDF. (The latter also accepts .png and
.jpeg.)

Herman

Jens Heise

unread,
Sep 8, 2001, 6:50:44 PM9/8/01
to
In <Pine.LNX.4.33.010908...@pc25-213.mech.kuleuven.ac.be>
Herman Bruyninckx wrote:
> On Sat, 8 Sep 2001, Richard Sperling wrote:
>
>
> epstopdf is a _program_ not a package :-)


Hello,

that's not correct. There also exist a package epstopdf written by Heiko
Oberdiek to provide automated conversion from eps to pdf during a run of
pdftex. It uses the \write18-feature of TeX so that must be enabled to use
the package.

Jens Heise

Richard Sperling

unread,
Sep 8, 2001, 11:26:01 PM9/8/01
to
You are only partially correct. epstopdf is both a program AND a
package, the latter written by Heiko Oberdiek. From the documentation:

% Function: This packages adds support of handling eps images
% to package graphic{s,x} with option `pdftex'.
% If an eps image is detected, epstopdf is automatically
% called to convert it to pdf format.
%
% Required: * The program `epstopdf'.
% * The feature `\write18' has to be enabled to get
% the conversion via the program epstopdf work:
% * command line option: -shell-escape
% example: pdflatex -shell-escape test.tex
% * configuraton file `texmf.cnf': shell_escape = 1
%
% Use: The package is loaded after graphic{s,x}, eg:
% \usepackage[pdftex]{graphicx}
% \usepackage{epstopdf}

So my original request for help stands. Thanks again for any
assistance.

Richard

Andrew E. Schulman

unread,
Sep 9, 2001, 8:42:52 AM9/9/01
to
Since epstopdf is also a program, one solution to your problem would be
to run it in advance. In bash,

for file in *.eps
do
epstopdf $file $(file%eps}.pdf
done

Run this once before you start, and then you can omit the epstopdf
package and not have to make repeated runs through your document.

Heiko Oberdiek

unread,
Sep 10, 2001, 11:32:17 AM9/10/01
to

There will be no repeated runs with the epstopdf package,
if the extension is omitted. A Makefile would make more
sense, because then epstopdf will only called if necessary.

Yours sincerely
Heiko <ober...@uni-freiburg.de>

Andrew E. Schulman

unread,
Sep 11, 2001, 4:45:19 AM9/11/01
to
> A Makefile would make more
> sense, because then epstopdf will only called if necessary.

True, except that then he has to maintain the makefile by keeping a
complete list of all the source files.

--
To reply by e-mail, change "deadspam.com" to "zzapp.org"

Dan Luecking

unread,
Sep 11, 2001, 12:47:51 PM9/11/01
to
Richard Sperling <rspe...@boo.net> wrote in message news:<57mkpt44llka79gpb...@4ax.com>...

> I'm new to pdflatex and epstopdf and I'm having a little trouble. I
> use MikTeX 2.1 and WinEDT on Windows 2000. There are \includegraphics
> declarations in my .tex document. The graphics are eps files named
> fig1.eps, fig2.eps, and fig3.eps (original, I know). I'm trying to
> use epstopdf to do the graphics conversion. In the preamble I have:
>
> \usepackage[pdftex]{graphicx}
> \usepackage{epstopdf}
>
> When I try to compile the .tex file using pdflatex I get the following
> sequence of errors:
>
> Error: May not be a PDF file (continuing anyway)
> Error (0): PDF file is damaged - attempting to reconstruct xref
> table...
> Error: Couldn't find trailer dictionary
> Error: Couldn't find xref table

I've tested this under MiKTeX 2.1 on Win95 with a simple .tex
file and simple .eps files and all worked. These messages
appear to indicate that the .pdf file is incorrect. Your later
message (that multiple runs eventually produced correct figures
but it took as many runs as the number of figures) suggests that
the .eps files are OK and that epstopdf (the programs) is able
to correctly process them (one at a time). It seems to me this
leaves the program calls as the culprit.

There is a known problem with nested program calls in in Win2k.
One method of doing system calls (viz. the one used by djgpp)
always fails if such calls are nested. The problem is allegedly
a bug in system .dlls. In your example, you have WinEdt calling
pdflatex.exe calling epstopdf.exe calling gswin32c.exe. It is
entirely possible the first call to gs succeeds but the second
aborts with a partially completed .pdf file.

You should check the following: can you simply run pdflatex on
your source file (in a DOS window, outside of WinEdt)? Can you
simply run epstopdf on the .eps files? You should probably also
show the newsgroup a small example file that fails to work, so
we don't speculate ourselves to death.

Other possible sources of problems: Do you have more than one
epstopdf around? What version of GS is installed?

Dan Luecking

Heiko Oberdiek

unread,
Sep 12, 2001, 8:36:23 AM9/12/01
to
On Tue, 11 Sep 2001 04:45:19 -0400, Andrew E. Schulman
<and...@deadspam.com> wrote:

> > A Makefile would make more
> > sense, because then epstopdf will only called if necessary.
>
> True, except that then he has to maintain the makefile by keeping a
> complete list of all the source files.

With GNU make this is possible with few lines in the Makefile:

# collect all .eps files in current directory:
images := $(wildcard *.eps)

# replace ".eps" file extension with ".pdf":
images := $(patsubst %.eps,%.pdf,$(images))

# implicite rule that calls epstopdf:
%.pdf : %.eps
epstopdf $<

# main rule for the project, for example:
all: test.tex $(images)
pdfelatex $<

Yours sincerely
Heiko <ober...@uni-freiburg.de>

0 new messages