## LaTeX forum ⇒ Graphics, Figures & Tables ⇒ Cannot determine size of graphic when inserted a pdf image Topic is solved

Information and discussion about graphics, figures & tables in LaTeX documents.
daiyue
Posts: 17
Joined: Mon May 21, 2012 5:58 pm

### Cannot determine size of graphic when inserted a pdf image

Hi, I tried to insert a pdf image using the code:

\usepackage{graphicx}\begin{figure}\centering\includegraphics[scale=0.4]{time_elapsed.pdf}\caption{Processing speed for SVM Classification}\label{fig5.5}\end{figure}

but got a error message:

! LaTeX Error: Cannot determine size of graphic in 5_Web_data_annotation_using_SVM/figures/time_elapsed.pdf (no BoundingBox).

I also tried:

\usepackage{pdfpages}\begin{figure}\centering\includepdf[scale=0.4]{time_elapsed.pdf}\caption{Processing speed for SVM Classification}\label{fig5.5}\end{figure}

but got the following error:

! Package keyval Error: page undefined.

I was using the very same image in eps (which is fine), and it is too large to upload to overleaf, so I decided to transform it to a pdf file. So how to resolve the issue.

Many thanks

Johannes_B
Site Moderator
Posts: 4161
Joined: Thu Nov 01, 2012 4:08 pm
You are trying to run pdflatex in DVI-mode, where only eps figures are allowed. Search for regular pdflatex in your editor and its buttons.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

synred
Posts: 6
Joined: Tue Feb 16, 2016 11:55 pm
I'm having this same problem with eps files.

I'm trying to move lyx document from Linux to eps. I get this error when I try to view a document containing an eps image. This image worked fine on Linux. I ran 'eps2eps' on it and it still doesn't work.

The error is coming from latex not lyx directly. lyx displays the image fine.

So far I see no solutions posted ...

synred
Posts: 6
Joined: Tue Feb 16, 2016 11:55 pm
So in the context of 'lyx' I found a work around ... use one of the other viewing options on offer in 'Documents' menu. The two div options and 'ps2pdf' as will as plain 'postscript' work. 'ps2pdf' looks best.

The default 'pdLatex' invoked by the googly eyes option does not work, but fails as described above and by original post in this thread.

I seem to recall being forced to use 'ps2pdf' in 'lyx' years ago on 'linux' as well but don't remember why.

As others with problem are not using 'lyx' it appears the problem is in 'pdLatex' somewhere ...

-Traruh

Johannes_B
Site Moderator
Posts: 4161
Joined: Thu Nov 01, 2012 4:08 pm
pdflatex cannot use eps files directly. This is neither a LyX thing, nor really an error of pdflatex. It is just a fact.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.