Extracting a vector image from a .pdf file
March 6, 2007 10:10 AM   Subscribe

How can I extract a figure from a .pdf file and save it as a vector image?

I need to include a figure in a latex file. It must be a vector image - either .eps or .pdf or another format from which I can convert to one of those two. I have a .pdf file of a paper that includes the figure and it is a vector image, but I don't have the original source. (don't worry about copyright issues, what I have in mind is fair use. also I don't have time to contact the authors and ask for the original source.)

My supervisor suggested printing to postscript and copying and pasting the figure from the postscript source. I tried this and was able to locate the figure based on some of the figure's text appearing, but I don't know enough postscript to figure out where the figure starts and ends.

Acrobat has the little screen-cap tool of course but my understanding is that this is not a vector image - and in any case I tried pasting the result into GIMP (running Linux) and it didn't work.

I have access to typical Linux tools and I can probably find a Windows workstation somewhere too. Oh yeah, and it has to be free, too.
posted by PercussivePaul to Computers & Internet (19 answers total) 3 users marked this as a favorite
You may be able to open the .pdf in Adobe Illustrator and then export it to an .eps file. I believe I used that method a few years ago.
posted by buttercup at 10:18 AM on March 6, 2007

This brief discussion makes it sounds like OpenOffice Draw will open an EPS to get vector graphics. If you can convert or print to EPS, maybe that will work.
posted by exogenous at 10:23 AM on March 6, 2007

Adobe Illustrater could probably open the PDF, allowing you to delete stuff you don't need and save the figure as a .eps. However it's not free.

Are there any vector apps for Linux that you can try and open the PDF with?

Finally this quote calls out for comment:

also I don't have time to contact the authors and ask for the original source.

That won't be a good excuse if they decide to sue you.
posted by Brandon Blatcher at 10:23 AM on March 6, 2007

What do you want to use to compose the final vector file? In many applications, you can place that page of the PDF whole and simply crop it down to just the figure you want.

Otherwise, this is another vote for illustrator, as long as the PDF isn't protected against editing.
posted by luriete at 10:32 AM on March 6, 2007

Response by poster: OK, I will ask around and see if any of my friends have access to Illustrator. I don't but somebody might. I am open to any other ideas as well.
posted by PercussivePaul at 10:37 AM on March 6, 2007

Response by poster: Also, Brandon, please see the sentence immediately preceeding the one you quoted.
posted by PercussivePaul at 10:42 AM on March 6, 2007

inkscape is free and according to the documentation you can (with a little work) import a PDF. it can output both ps and svg.
posted by paradroid at 10:47 AM on March 6, 2007

Second Inkscape, but if importing as a vector fails, import a raster (e.g. jpg) of it and use the trace function.
posted by anaelith at 11:04 AM on March 6, 2007

On OS X, use Graphic Converter (or similar program) to open the PDF. Trim/Smart Trim the figure, save in a format you like, and put in LaTeX. Use the graphicx package. Then check this page to see if you need any hacks.
posted by GarageWine at 11:16 AM on March 6, 2007

I use the open source and free GSview with the pstoedit add-on installed. GSview is a GUI front-end for Ghostscript, so that must be installed first. I frequently convert pdfs to autocad's DXF format (vector) with this tool, both are available for Linux. (even though i use the windows version)
posted by Wezzlee at 12:01 PM on March 6, 2007

Ohh i failed to mention that YMMV, due to the fact that conversion is effected by what (software) originally created the image within said PDF.
posted by Wezzlee at 12:06 PM on March 6, 2007

Fair use is not a right, it is an affirmative defense to a copyright infringement claim. Don't confuse the two. Fair use doesn't give you permission, though it may give you an excuse if you get sued.

Always best to ask permission.
posted by Merdryn at 12:11 PM on March 6, 2007

Illustrator is the best way to crack-open a PDF to extract vector images. I have to do it on a regular basis.
If you don't have access to illustrator....well...my email is in my profile.
posted by Thorzdad at 12:41 PM on March 6, 2007

Wow. Did not know Illustrator could do that. Makes sense, as they are both Adobe products. +1 for my AskMe reading today!
posted by bullitt 5 at 12:50 PM on March 6, 2007

Mod note: Deleted some fair use argumentation; take it elsewhere, please.
posted by cortex (staff) at 2:28 PM on March 6, 2007

Response by poster: Thank you cortex.

I want to clear this up for the record. I had hoped it would not be necessary to get into the elaborate backstory. It scarcely seemed relevant to me, because none of you had any idea of my purposes (maybe it's public domain? maybe it's just for a school project?) so why would you care? hence 'don't worry about copyright' where I meant 'I've got it taken care of'. I figured my word would be enough and you would all give me the benefit of the doubt. Guess not.

The source is published in a technical document. The copyright holder is the IEEE, a technical publisher. The destination is a journal paper to be hopefully published by the IEEE. It is common practice in the industry, especially in survey papers like the one I'm writing, to occasionally re-use other people's figures with full attribution, i.e. a reference in the figure caption, which of course we planned to do. As a courtesy we also planned to notify the original authors that we had referred to their work and included one of their figures, and if they had any objections we would of course remove it, but objections are unlikely because the original authors and one of my co-authors are colleagues. But the submission deadline is coming up too quickly for any kind of back and forth so such changes would have to be made while the paper is under review.

Satisfied, everyone? Have I cleared my good name? >:(

Thanks to the rest of you for actually answering the question. I had no luck with Inkscape but I will probaly be able to find someone with Illustrator.
posted by PercussivePaul at 2:47 PM on March 6, 2007

My understanding is that Graphic Converter is a bitmap app, and you won't get it out as a vector.

Find someone with a Mac. The Preview application which opens PDFs by default will let you select an area, copy it, and paste it as a new file which can be saved as a PDF, vectors intact.
posted by edd at 3:46 PM on March 6, 2007

Best answer: Illustrator's been available as a 30-day trial. This would be the first thing I would try in your position; I know it works directly with PDF files, while some of the other items require intermediate steps.
posted by Pronoiac at 5:28 PM on March 6, 2007

Response by poster: Thank you to everyone who suggested illustrator, but especially Pronoiac who mentioned the 30-day trial, which I didn't know about. It worked like a dream and it was just what I needed.
posted by PercussivePaul at 1:31 PM on March 10, 2007

« Older Wordpress subscriber options?   |   iTunes 7 not working Newer »
This thread is closed to new comments.