GeneralInclude PDF Graphics in Latex

LaTeX specific issues not fitting into one of the other forums of this category.
darren
Posts: 5
Joined: Thu Nov 27, 2008 11:43 am

Include PDF Graphics in Latex

Post by darren »

Hi,
Im a novice user and
I need to include a pdf graphics in Latex. I used the following code:

\documentclass[a4paper,12pt]{article}
\usepackage[dvips]{graphics}
\usepackage{graphicx}
\usepackage{graphics}
\usepackage{psfrag}

\begin{document}
\begin{figure}

\includegraphics{a.pdf}

\caption{picture}
\label{myfig}
\end{figure}
\end{document}


I am getting a blank space for the figure in my DVI output page.
and i got no result in any format.

Just being curious, do i need to include the location where i store all my pdf graphics in my Latex commands?

They gave me this error message:
LaTex error: Cannot determine the size of graphics in a.pdf (no Boundingbox)

urgently need help..can someone please help me with this? :cry:

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Medova
Posts: 28
Joined: Thu Nov 06, 2008 4:20 pm

Re: Include PDF Graphics in Latex

Post by Medova »

Normally if you get the error "no Boundingbox", something is wrong with your picture - The size might not be defined in the file. But I get the same problem here, so don't think that's the prob.

To solve your problem open the PDF-picture in Adope Acrobat, save it as an EPS-picture and use

\includegraphics{a.eps}

That works...
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Include PDF Graphics in Latex

Post by localghost »

You can't include PDF graphics when compiling with latex. You have to compile directly with pdflatex or convert your PDF graphics to EPS. The process depends on the desired final output. Include the [url=htpp://ctan.org/pkg/graphicx]graphicx[/url] package only once in your document with out any driver option.


Best regards and welcome to the board
Thorsten¹
darren
Posts: 5
Joined: Thu Nov 27, 2008 11:43 am

Re: Include PDF Graphics in Latex

Post by darren »

Sorry but how do i convert my PDF files to EPS images in ADobe Reader 8.0?
Last edited by darren on Thu Nov 27, 2008 12:47 pm, edited 1 time in total.
dpresv
Posts: 5
Joined: Thu Nov 27, 2008 12:30 pm

Re: Include PDF Graphics in Latex

Post by dpresv »

excuse my messing here, i'm only a novice in the word of latex, but i think you can perfectly add pdf graphic files in the document.

using TeXnicCenter and MikTeX 2.7 what i do is create a pdf of the image of graph i want to include in the document, place it in the latex document folder and simply add the graph as a pdf. to explain myself better, let's say i want to include a graph of voltage versus current. i export from the graphics processing software the graph as an image (tiff for better results). i import the image in adobe acrobat professional and create the voltage_current.pdf, (it is perfectly identical to the image) and put it in the latex document folder. then i add this pdf image in the document as

\usepackage{graphicx}

\begin{figure}[ht]
\centering
\includegraphics[width=6cm,keepaspectratio]{voltage_current}
\label{ypertaseis}
\end{figure}

and directly compile it to pdf ( TeXnicCenter option Latex=>PDF ). Make sure you put a small enough width (or height, whatever is larger) so that your page can contain it. i hope this post is helpful....
dpresv
Posts: 5
Joined: Thu Nov 27, 2008 12:30 pm

Include PDF Graphics in Latex

Post by dpresv »

darren wrote:My ADobe Reader 8.0 doesnt seem to allow me to convert my pdf images into EPS images.

What should I do?
i am not sure whether the simple adobe reader can allow you to create pdf files or let you mess with your existing ones, if can get hold of adobe acrobat professional you will have no problem, otherwise use one of the free pdf making utilities that you can find in the web
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Include PDF Graphics in Latex

Post by localghost »

darren wrote:Sorry but how do i convert my PDF files to EPS images in ADobe Reader 8.0?
This is not possible, as the name of the program already states "Reader". At first you should clarify what the desired format of the final output for your document shall be.
darren
Posts: 5
Joined: Thu Nov 27, 2008 11:43 am

Re: Include PDF Graphics in Latex

Post by darren »

my ultimate format for this would be a PDF form.
dpresv
Posts: 5
Joined: Thu Nov 27, 2008 12:30 pm

Include PDF Graphics in Latex

Post by dpresv »

darren wrote:my ultimate format for this would be a PDF form.
since you have a pdf and want a pdf, did you try doing what i suggested? put the pdf graph in the same folder as the latex document and exclude the .pdf extension in the file declaration in latex. also use the size definer command in the case your image is very big/
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Include PDF Graphics in Latex

Post by localghost »

darren wrote:my ultimate format for this would be a PDF form.
As dpresv already stated, a conversion is not needed. Pay attention to my statement regarding the graphicx package in my first reply. Omit any driver option like dvips or pdftex. The suffix to the name of the graphics file can also be omitted. The package will search the right version on its own.
Post Reply