Looking for a program to pull images from PDF files

Thoughts, Help, Feature Requests, Bug Reports, Developing code for...

Moderators: dorpond, trevor, Azhrei

Forum rules
PLEASE don't post images of your entire desktop, attach entire campaign files when only a single file is needed, or generally act in some other anti-social behavior. :)
Post Reply
User avatar
TheIneffableCheese
Cave Troll
Posts: 64
Joined: Sun Mar 22, 2015 3:57 pm

Looking for a program to pull images from PDF files

Post by TheIneffableCheese »

I pull a lot of images out of PDF files for use in MapTool; most notably character portraits for tokens and maps for backgrounds.

I am looking for a program that will automatically pull all the images out of a PDF, but one that will retain the transparency of the images when present. I've found several programs that will automatically pull the images, but they have all stripped the transparency information leaving portrait images with solid black where the alpha was.

I'm currently using LibreOffice Draw which allows me to copy the images to the clipboard with the transparency. I can then paste that into GIMP, and then export to a PNG file retaining the transparency. It works, but I would much rather find something that would automate the process.

Thanks!

User avatar
Oryan77
Dragon
Posts: 452
Joined: Sun Feb 20, 2011 3:14 pm

Re: Looking for a program to pull images from PDF files

Post by Oryan77 »

Photoshop can pull out the png images. You open the pdf in PS and select which images to open up. Then you save each image. You can run a batch process to save all of the open images if there are too many images to save one at a time.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Looking for a program to pull images from PDF files

Post by Phergus »

Or you can just use MapTool.
  • Place the PDF in one of your MapTool resource folders.
  • Start MapTool (recommend bumping max memory up)
  • In the Resource Library window, browse to your PDF and click on it.
  • Wait while MT extracts the images.
  • Pull images onto map.

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Looking for a program to pull images from PDF files

Post by Full Bleed »

Phergus wrote:
Thu Jun 06, 2019 12:35 pm
Or you can just use MapTool.
  • Place the PDF in one of your MapTool resource folders.
  • Start MapTool (recommend bumping max memory up)
  • In the Resource Library window, browse to your PDF and click on it.
  • Wait while MT extracts the images.
  • Pull images onto map.
:shock:

This is *NEW* information!

Very cool and convenient.

Thanks for the tip. :)
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

taustinoc
Dragon
Posts: 518
Joined: Mon Aug 03, 2015 6:30 pm

Re: Looking for a program to pull images from PDF files

Post by taustinoc »

Note that it can take a long time to process the PDF, if there are a lot of images in it. And it doesn't always work if the PDF is encrypted.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Looking for a program to pull images from PDF files

Post by Phergus »

Full Bleed wrote:
Fri Jun 07, 2019 1:18 pm
This is *NEW* information!
It is? Pretty sure PDF support was mentioned in the 1.5.0 release but I didn't check.
Full Bleed wrote:
Fri Jun 07, 2019 1:18 pm
Very cool and convenient.

Thanks for the tip. :)
Quite welcome. :)

Bonus tip:
After MT has finished extracting the PDF, go to

Code: Select all

C:\Users\<yourname>\.maptool-rptools\tmp
And there will be a directory containing all the images that you can copy somewhere else for future usage and won't have to wait for them to extract the next time. (You can also delete all the extra crap that isn't needed.)

User avatar
Full Bleed
Demigod
Posts: 4736
Joined: Sun Feb 25, 2007 11:53 am
Location: FL

Re: Looking for a program to pull images from PDF files

Post by Full Bleed »

Phergus wrote:
Fri Jun 07, 2019 3:28 pm
Full Bleed wrote:
Fri Jun 07, 2019 1:18 pm
This is *NEW* information!
It is? Pretty sure PDF support was mentioned in the 1.5.0 release but I didn't check.
The specific functionality was bundled with info about Hero Lab (POR file) support, which is easy to gloss over if you don't use Hero Lab. When seeing a note of "pdf integration" I certainly didn't expect that MT would explode out PDF assets when viewing one. I figured it was just some kind of PDF viewer (which, frankly, wasn't functionality I really felt I needed built into MT.)

But for further reference for those that may be interested: https://www.rptools.net/2019/03/new-res ... r-and-pdf/
Bonus tip:
After MT has finished extracting the PDF, go to

Code: Select all

C:\Users\<yourname>\.maptool-rptools\tmp
And there will be a directory containing all the images that you can copy somewhere else for future usage and won't have to wait for them to extract the next time. (You can also delete all the extra crap that isn't needed.)
This is good info, too... but it's not a great implementation when a file has transparency. It save files as jpg's in the tmp folder (which is what a lot of batch image exporters do, too.) To preserve the transparency, you have to drag the image to the map and right-click Save>Token Image. Then you get a png asset.
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."

User avatar
TheIneffableCheese
Cave Troll
Posts: 64
Joined: Sun Mar 22, 2015 3:57 pm

Re: Looking for a program to pull images from PDF files

Post by TheIneffableCheese »

Thanks for the suggestions. I'm definitely going to have to play with the new PDF functionality built into the program.

Phergus
Deity
Posts: 7132
Joined: Fri May 12, 2006 8:56 pm
Location: Middle of Nowhere, NM
Contact:

Re: Looking for a program to pull images from PDF files

Post by Phergus »

Full Bleed wrote:
Fri Jun 07, 2019 4:31 pm
This is good info, too... but it's not a great implementation when a file has transparency. It save files as jpg's in the tmp folder (which is what a lot of batch image exporters do, too.)
You'd complain if they hung you with a new rope. :roll:

It saves files that were embedded in the PDF as JPGs out as JPGs. Chances are they were CMYK JPGs. When they are brought into MT, they get converted to RGBA images and can then be saved as PNG files.

Any files embedded in the PDF as PNG files are extracted as PNGs. I've also seen the odd GIF and BMP file.
Full Bleed wrote:
Fri Jun 07, 2019 4:31 pm
To preserve the transparency, you have to drag the image to the map and right-click Save>Token Image. Then you get a png asset.
Or you can load the PDF into TokenTool - which has has also had this capability for a while - and drag them directly out of the PDF preview window into a folder of your choosing.

Post Reply

Return to “MapTool”