PDA

View Full Version : Extracting images from a PDF - I must be missing something...



Minty23185Fresh
June 8th, 2018, 16:39
I'm wading through the numerous threads that discuss image extraction/copying from a PDF, looking for the right tool for the job. Numerous applications are mentioned. What I am failing to see is why one needs to employ any of them when Adobe (PDF) Reader works just fine.

I have an adventure that I bought from DriveThru RPG. I am trying to convert or migrate it over to a Fantasy Grounds module. In addition to all the text I want to include the images. The images appear to be raster based embedded graphics. The PDF is watermarked so DriveThru has password protected it to prevent editing/modification.

For the sake of argument let's assume Adobe Reader (free, no cost) is the industry default PDF viewer/reader. If I open the adventure in Adobe Reader I can click on an image to select it, then copy it to the Windows clipboard using Ctrl-C or right clicking and Copy Image. From there I can paste the copied image to the application of my choice (say Window Paint) and save it to disk as a single extracted image (for example .png).

I tried this with various other tools and applications, with varying results. But if an when I was successful my resultant .png file was of no better quality than the simple copy image related above. So why use something other than the default PDF viewer.

Here are programs/applications that I tried, all of them saved the image as a 897 X 665 pixel, 24 bit color depth .png file:
Adobe (PDF) Reader
Adobe Photoshop Elements - would not open the PDF because of the password
Adobe Photoshop Elements - could paste into Elements from Adobe Reader
Corel Painter Elements (raster based image editor, like Photoshop - could not open a PDF)
Corel Painter Elements - could paste into application from Adobe Reader
Krita (free raster based image editor) - able to open PDF and extract multiple images
Gimp - I don't use Gimp, I use Krita instead
Microsoft Paint - could paste into application from Adobe Reader
Paint.net - could paste into application from Adobe Reader
Inkscape (free vector based image editor, like Adobe Illustrator) - open multiple images for extraction
ExtractPDF (web based image extractor) - multiple images from a single PDF

So I will reiterate the question: Why use another application such as Photoshop, Corel, Gimp, Krita, etc, etc, instead of the industry default Adobe Reader and the free with Windows, Microsoft Paint?

(as a caveat, there are other factors to consider based on the internal configuration of the PDF, but we'll see how this discussion shakes out before addressing those.)

Trenloe
June 8th, 2018, 17:25
Adobe Reader won’t allow copying of every image from all PDFs. Some security/PDF layouts don’t allow it.

Also, some images copied this way will have the background transparency layer come through as a very ugly black background, that can be a pain to 100% get rid of.

Also, it can be a laborious task to manually copy/paste/save each image for a big PDF. Some image extraction processes will get all of the images out at once.

In the end, go with what works for you for the PDFs that you use and the end result you require.

LordEntrails
June 8th, 2018, 18:25
As Trenloe says, it depends on the original PDF.

The other thing I've had, is sometimes the image comes out through a cut and paste mirrored.

Apparently the layout or something mirrors it. Adobe Reader is currently my default PDF viewer, so I try that first. When it doesn't work I try Gimp. Then sometimes other things if I have to.

Minty23185Fresh
June 8th, 2018, 21:29
Okay, I was missing something... An uncooperative PDF! I just got lucky I guess.

So I'll continue to compile a list of extractors and editors people mention in the forums. I'll also try to compile a list of issues that cause one to have to search for an alternative solution to Adobe Reader and one's favorite editor.

Thanks for the help.

(As I was compiling information I used this post as my scratch area. All that information has been summarized here (https://www.fantasygrounds.com/forums/showthread.php?44133-PDF-Conversion-to-an-FG-Module-Information-Index&p=392188#post392188).

These are some of the threads I read through (among others), as of June 15, 2018:
"PDF" threads, Google site search results, by relevance:
Newbie question: Export to PDF (https://www.fantasygrounds.com/forums/showthread.php?41592-Newbie-question-Export-to-PDF)
PDF Import To Library. Can it happen? (https://www.fantasygrounds.com/forums/showthread.php?22190-PDF-Import-To-Library-Can-it-happen)
How To Extract Images From A PDF (https://www.fantasygrounds.com/forums/showthread.php?40832-How-To-Extract-Images-From-A-PDF)
How to import Adventures from pdf format? (https://www.fantasygrounds.com/forums/showthread.php?20980-How-to-import-Adventures-from-pdf-format)
Extracting graphics from a PDF (https://www.fantasygrounds.com/forums/showthread.php?37147-Extracting-graphics-from-a-PDF)
How to Convert PDF to FG (https://www.fantasygrounds.com/forums/showthread.php?17277-How-to-Convert-PDF-to-FG)
Transferring tables in a .pdf in to Fantasy Grounds (https://www.fantasygrounds.com/forums/showthread.php?37737-Transferring-tables-in-a-pdf-in-to-Fantasy-Grounds)
Cleaning up ugly PDF's for copying and pasting (https://www.fantasygrounds.com/forums/showthread.php?24958-Cleaning-up-ugly-PDF-s-for-copying-and-pasting)
AL module conversion from PDF to FG (https://www.fantasygrounds.com/forums/showthread.php?37520-AL-module-conversion-from-PDF-to-FG)
Copying images from Pdf (https://www.fantasygrounds.com/forums/showthread.php?35525-Copying-images-from-Pdf)
Capturing images from PDF docs (https://www.fantasygrounds.com/forums/showthread.php?28011-Capturing-images-from-PDF-docs&highlight=pdf+export)

madman
June 9th, 2018, 00:15
I have found that Acrobat does the best job. But the cost is high for just the ability to remove Images from a PDF.
I have a friend that likes foxit (I think it's called) But I have never used it!

Madman..

LordEntrails
June 9th, 2018, 00:40
I've used Foxit, year ago it was incredible fast on startup and opening files.

I've also used PDF X-change Editor. I think it has changes it's name. It had a very functional free editor and a pretty inexpensive full package.

Haven't used either in awhile.

ColinBuckler
June 9th, 2018, 10:27
Have a look at a script I wrote using a 3rd party utility:

https://www.fantasygrounds.com/forums/showthread.php?40832-How-To-Extract-Images-From-A-PDF

It extracted 1,300 images in about 15 seconds.

damned
June 9th, 2018, 11:22
Have a look at a script I wrote using a 3rd party utility:

https://www.fantasygrounds.com/forums/showthread.php?40832-How-To-Extract-Images-From-A-PDF

It extracted 1,300 images in about 15 seconds.

I have used your script successfully.

Nyghtmare
June 10th, 2018, 05:05
I had to manually rename the PDF file to z.pdf to get it to work, but then it took like a second to rip out all of the files from it — even when I gave it administrative rights and allowed it to change the file through my virus checker.

That is fine with me, though — minimal effort for maximum results.