## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Inserting a PDF file into Exam class

Information and discussion about graphics, figures & tables in LaTeX documents.
megatunnage
Posts: 1
Joined: Mon Mar 06, 2017 11:45 pm

### Inserting a PDF file into Exam class

Hi, I'm writing a quiz using the Exam class, and I want to insert a pdf of a vector field. The file is called 'vfield1' and it's located in the same directory as my tex file. I'm using WinEdt 8.1 and compiling with the 'PDFTexify' button.

However, I keep getting the error message, "Package pdftex.def Error: File 'vfield1.pdf' not found." Here's the code that I have:

2. \usepackage{amsmath}
3. \usepackage[utf8]{inputenc}
4. \usepackage{graphicx}
6.
8. \extrafootheight{-3in}
9.
10. \begin{document}
11.
12. \begin{center}
13. \vspace{0.2in}
14. \fbox{
15. \parbox{6in}
16. {\centering
17. To receive full and partial credit, ALL work must be shown. }}
18. \end{center}
19.
20. \begin{questions}
21. \question
22. Determine and justify which differential equation matches the following direction field:
23. \includegraphics{vfield1.pdf}
24. \end{questions}
25.
26. \end{document}

What's interesting is that if I use the Article class, I don't get any errors and it compiles fine:

1. \documentclass{article}
2. \usepackage{amsmath}
3. \usepackage{graphicx}
4.
5. \begin{document}
6.
7. \includegraphics{vfield1.pdf}
8.
9. \end{document}

Any ideas what's causing the problem in the Exam class code?

Tags:

Stefan Kottwitz
Posts: 9413
Joined: Mon Mar 10, 2008 9:44 pm
Welcome to the forum!

That's actually strange, because it writes pdfTeX is used but cannot read PDF. Are you really sure that the main document is in the same folder as the pdf image? I sometimes think I'm working in a folder but the document I'm working on was saved to another place. Perhaps explicitly save again to that folder with another name.

Please post the .log file of the compiler run here, as attachment.

Stefan