Extracting image from PDF to use in LaTeX document?

use

\includegraphics[page=...,viewport=llx lly urx ury,clip]{pdf-file}

or run

pdfimages [options] <PDF-file> <image-root>

the first one simply inserts the page=<no> of your pdf and clips everything around the viewport. The second one is a Linux command, which extracts all images from a pdf file, eg

pdfimages -f1 -l4 <PDF-file> .

extracts the images of pages 1--4 into the current directory


Alternatively you could extract the data from the graph and then recreate it in your own style. There are several programs available that digitize graphs (e.g. http://digitizer.sourceforge.net/) and in the end this is often the much nicer than a copy&paste and also avoids copyright issues.


I will assume that you are using OS X with TeXShop and that your original file is in pdf format.

A manual solution that works if there aren't too many images to copy is as follows.

TeXShop's pdf viewer allows you to copy part of a page or image. It works even for pdf files that don't come from a tex file. All you have to do is select the region you want copied with the rectangle selection tool and drag the image to your desktop (or other folder). In TeXShop's preference pane you can select the format of the copied image (pdf, png, etc.)

Maybe other pdf viewers behave like this but since I don't use them I don't know.

Tags:

Pdf

Graphics