[texhax] ! Package pdftex.def Error

Heiko Oberdiek heiko.oberdiek at googlemail.com
Mon Oct 10 22:41:18 CEST 2011


On Sun, Oct 09, 2011 at 02:10:36PM -0700, Silav Bremos wrote:

> I downloaded and successfully installed MikTeX2.9.
> From the Command Prompt in Windows XP, I am able to create pdf with this command:
> C:\Users\...\My Documents>pdflatex example-1.tex
> 
> However, in Windows 7 it gives me this error:
> ! Package pdftex.def Error: File `example-1-002.pdf' not found.
> See the pdftex.def package documentation for explanation.
> Type  H <return>  for immediate help.
>  ...
> l.31 \includegraphics{example-1-002}
> ?
> I checked the current directory and the file example-1-002.pdf is created
> but without the figure.

A minimal example looks like

\listfiles
\documentclass{article}
\usepackage{graphicx}
\begin{document}
\includegraphics{example-1-002}
\end{document}

Then a image file `example-1-002.<EXT> with a supported
extension (e.g. pdf, png, jpg, ...) must exist, where
it can be found. Otherwise you get a LaTeX error:
  ! LaTeX error: file `example-1-002' not found.
To get the error quoted above, the non-existing file is given
with an *explicit* extension:
  \includegraphics{example-1-002.pdf}
Also check your .log file, I expect there is a LaTeX warning
preceding the error message:
  LaTeX Warning: File `example-1-002.pdf' not found on input line 31.
At last the last sentence of the problem report should probably
read
| I checked the current directory and the file example-1.pdf is
| created but without the figure.

Yes, this is a feature of pdftex.def. If the image file is
not found, `draft' mode is enabled for this image. Other
graphics drivers create following errors instead.

Summary: It seems you have forgotten to add the image files
to the current directory needed by your .tex file.
And that tells the error message already.

Yours sincerely
  Heiko Oberdiek


More information about the texhax mailing list