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!
Looking for a program to pull images from PDF files
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.
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.
- TheIneffableCheese
- Cave Troll
- Posts: 64
- Joined: Sun Mar 22, 2015 3:57 pm
Re: Looking for a program to pull images from PDF files
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.
Re: Looking for a program to pull images from PDF files
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.
- 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
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."
Re: Looking for a program to pull images from PDF files
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.
Re: Looking for a program to pull images from PDF files
It is? Pretty sure PDF support was mentioned in the 1.5.0 release but I didn't check.
Quite welcome.
Bonus tip:
After MT has finished extracting the PDF, go to
Code: Select all
C:\Users\<yourname>\.maptool-rptools\tmp
- 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
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/
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.Bonus tip:
After MT has finished extracting the PDF, go toAnd 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.)Code: Select all
C:\Users\<yourname>\.maptool-rptools\tmp
Maptool is the Millennium Falcon of VTT's -- "She may not look like much, but she's got it where it counts."
- TheIneffableCheese
- Cave Troll
- Posts: 64
- Joined: Sun Mar 22, 2015 3:57 pm
Re: Looking for a program to pull images from PDF files
Thanks for the suggestions. I'm definitely going to have to play with the new PDF functionality built into the program.
Re: Looking for a program to pull images from PDF files
You'd complain if they hung you with a new rope.Full Bleed wrote: ↑Fri Jun 07, 2019 4:31 pmThis 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.)
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.
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.Full Bleed wrote: ↑Fri Jun 07, 2019 4:31 pmTo preserve the transparency, you have to drag the image to the map and right-click Save>Token Image. Then you get a png asset.