# Package pdftex.def error PDF mode expected

Took me 6 hours today and still doesn't work, the error is :

Package pdftex.def error PDF mode expected mf-texlive/tex/latex/pdftex-def/pdftex.def


Example document:

\documentclass{article}
\usepackage[pdftex]{graphicx}
\begin{document}

\includegraphics[scale=0.5,angle=90]{histogram_DSC_activity.eps}

\section{Title}
\end{document}


when I change it to

\usepackage{graphicx}


I get cannot determine size of graphic in the figure file. I check all remedy on google and here but ... also tried picture with pdf format.

-
Just to confirm---are you using latex or pdflatex? –  Sharpie May 8 '11 at 20:52
I am using latex –  user5387 May 9 '11 at 5:02
Then it sounds like your EPS file is missing a bounding box. –  Sharpie May 9 '11 at 5:05

If you are using latex, i.e. the DVI mode of LaTeX, which supports EPS then you should remove the incorrect pdftex option from the graphicx package. The packages should be able to figure out the used driver by themselves, so you should avoid such options anyway. If you are using pdflatex then it would be better to convert the EPS to a PDF file manually, e.g. using the epstopdf tool (I'm not sure if it comes with the Windows version, but I think so). You need to change the .eps extension to .pdf then, of course. You can also drop the extension and LaTeX will look for files with the given base name with all supported extensions, i.e. \includegraphics{file} will use file.eps for latex and file.pdf (or file.png, file.jpg) for pdflatex.
the order in which extensions are tried is .png, .pdf, .jpg, .mps, .jpeg, .jbig2, .jb2; after these, uppercase extensions are tried in the same order (with the exception of MPS). It's probably useful to remark this, since it can cause some head scratching. –  egreg May 8 '11 at 21:53
@egreg: Thanks for mentioned that. I knew it but didn't recall the exact order. We should then also mention that the order can be changed by \DeclareGraphicsExtensions{<comma separated list of extensions>}. –  Martin Scharrer May 8 '11 at 22:14