Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a PDF file containing maps of the building I work in, here:

The original source files have been lost, and I've been asked to extract the map images, preferably without the text and icons that have been overlaid on top of them. This has proven annoyingly difficult.

So far, I have tried the following GUI programs:

  • Adobe Reader: lets me select text, but not the background images
  • FoxIt PDF Viewer: lets me select text, but not the background images
  • XPDF on Ubuntu 10.10: lets mes select text, but not the background images

And also the following command-line programs:

  • pdfimages: extracts the icons indicating bathrooms just fine, but not the background images
  • pdftohtml: same as pdfimages, plus it makes a poorly marked up HTML document
  • pdfextract: same as pdfimages
  • convert: successfully saved images, but with the text burned into them

I've even tried opening the PDF manually in a text editor and extracting the stream objects by pasting them into a new file and saving it with a .jpg, .png, or .bmp extension (each in turn). Considering how little I know about the internal structure of PDF files, it's no surprise that this didn't work.

So ... is there any way I can retrieve the map images from this thing without also getting the text and icons?

share|improve this question
The way I usually solve this kind of task: (1) Use qpdf to convert the binary parts to ASCII as far as possible. (2) Use a text editor to make all text invisible that I don't want to see on screen or in printouts (can be achieved easily and without damage to the XRef table by toggling the invisible flag). (3) Re-distill the result with Ghostscript to boil down its size as much as possible. -- Unfortunately, your file is no longer downloadable to demonstrate the procedure... – Kurt Pfeifle May 28 '11 at 6:06
up vote 6 down vote accepted

You can download the XPDF library from for Linux and Windows. Then run pdfimages -j input.pdf output and you should get output-000.jpg, output-001.jpg, etc. Also, check out for more usage options.

share|improve this answer
Correction, looks like the image is a vector graphic directly embedded in the PDF. Try opening it in something like Inkscape or Adobe Illustrator that handles vector graphics. – mybluevan May 27 '11 at 18:05
Ah HA! The maps are vector graphics -- no wonder I've been having such trouble! Inkscape seems to have opened it just fine, and I can edit it to my heart's content. Thanks! – Will Martin May 27 '11 at 18:27

Ok, after messing around with this for 5 minutes, my analysis is that PDF is even weirder than I originally thought, and that's saying something.

Not sure what your budget is, but with Acrobat Pro Extended 9, you can use:

A. Tools, Advanced Editing, Touchup Text Tool

-Select All
-Right click, Properties
-Text tab
-Select a standard font (e.g. Arial), close
-Hit Delete

B. Tools, Advanced editing, Touchup Object Tool

-Select the object (you can get most, but not all, of them (e.g. student computers icons can't be selected), then delete

Here's what Page 1 looked like after a quick cleanup:

share|improve this answer
Weird is understatement. I don't know the history of this file, but Acrobat Pro 8 gave us trouble. Inkscape did the trick, though, thank goodness. Now to convert it all to some proper SVGs that we can generate raster graphics from ... – Will Martin May 27 '11 at 18:29
The job you've done on the original PDF (which, unfortunately, is no longer available to me) is not the best. Your file is still ~3 MByte. It contains lots + lots of un-used objects. It even contains an instance of the /AA operator (for Automatic Action) makeing it a potentially dangerous PDF file. Ghostscript was able to boil it down to 60 kByte without loosing any of its visible content. (The metadata contained in the file spreads over 17 different objects. The metadata als suggests there are 17 different revisions/modifications of that file since its creation on 2011-01-18.) – Kurt Pfeifle May 28 '11 at 6:00
@pipitas I'm glad I checked this again, it turns out Apache was down on that server. The original PDF is available again. It's still annoying though. I've since discovered that the maps were generated from AutoCAD DXF files, which make for seriously ugly vector graphics. There are hundreds of individual paths in each map, each one a single line with two end points. This probably made it easier for an architect to alter individual sections of wall or whatever, but it's a pain in the butt for anything else. – Will Martin May 28 '11 at 23:43
@Will Martin: Ouch!, this is a rather big PDF file containing a lot of internal, hidden file updates (and therefor: garbage from a user point of view). -- 16 pages on 16 MBytes is rather "heavy" for just simple looking vector graphics. At least 16 different layers ("Optional Content" in PDF parlance), one for each page. I'd rather not wade through this mess with a text editor only... – Kurt Pfeifle May 29 '11 at 12:07
@pipitas: Thanks - fair points. Although I wouldn't describe what I did as a "job" - I was just demonstrating (after a couple minutes of playing around) that it was possible with Acrobat. Money back guarantee and all that. ;) – Craig H May 30 '11 at 20:46

Take the PDF which was made by Craig H and optimize it a bit by running it through Ghostscript. On Windows the commandline is:

gswin32c.exe ^
   -o p1test-gs-optimized.pdf ^
   -sDEVICE=pdfwrite ^
   -dPDFSETTIINGS=/prepress ^

On Linux/Unix/Mac OS X do:

gs \
   -o p1test-gs-optimized.pdf \
   -sDEVICE=pdfwrite \
   -dPDFSETTIINGS=/prepress \

This will bring down the size of the file from 3.000 kByte to about 60 kByte without loosing content. Then importing it to Inkscape (or InDesign, Illustrator,...) should be much faster....

share|improve this answer could try Photoshop. It reads PDF's, and it's 'possible' it originated in PS and possibly still has the layers... but it's a very long-shot.

share|improve this answer

Open the document on your screen, zoom in on the picture to make it as large as possible but all of it is still visible. Press alt+prnt scrn (or the equivalent on your operating system) and it should take a screen shot of the program. Now open up paint or your favorite image editor (photoshop, gimp, etc) paste in the picture and crop out anything you don't want.

share|improve this answer

In a Linux environment I have used pdfmod to extract all the images in one go. See or, for Ubuntu users,

To download and install it in Ubuntu, it is sufficient to type sudo apt-get install pdfmod.

  • Start the pdfmod GUI (type in pdfmod in the dashboard or command-line terminal)
  • Open the PDF document
  • Select all the pages (or any that you want to extract the images from)
  • The Edit menu item will present the option of extracting as many images as they can be extracted within the selected range (export n images, with n the appropriate number). You can also access this command by hovering with your mouse on the selection and activating the local menu (right-click for the right-handed).
  • Once you go ahead with this, a new window will open up where you select the location to save the images into.

Hope this helps.

share|improve this answer
Please read How do I recommend software for some tips as to how you should go about recommending software. Provide more than just a link, for example well as some additional information about the software itself, and how it can be used to solve the problem in the question. You could even include some example command lines. – DavidPostill Apr 10 at 18:23
@DavidPostill. Thanks for pointing this out. Done, I believe. – XavierStuvw Apr 11 at 9:20
Much better ... ;) – DavidPostill Apr 11 at 9:45
Now I know what I can demand from answers to my posts :-) – XavierStuvw Apr 11 at 10:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .