Graphics, Figures & TablesCannot determine size of graphic when inserted a pdf image

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

Cannot determine size of graphic when inserted a pdf image

Post by daiyue »

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

Code: Select all

\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:

Code: Select all

! LaTeX Error: Cannot determine size of graphic in 5_Web_data_annotation_using_
SVM/figures/time_elapsed.pdf (no BoundingBox).
I also tried:

Code: Select all

\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:

Code: Select all

! 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

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics TikZによるLaTeXグラフィックス
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Cannot determine size of graphic when inserted a pdf ima

Post by Johannes_B »

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

Re: Cannot determine size of graphic when inserted a pdf ima

Post by synred »

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

Re: Cannot determine size of graphic when inserted a pdf ima

Post by synred »

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
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Re: Cannot determine size of graphic when inserted a pdf ima

Post by Johannes_B »

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.
Post Reply