Dump Pasted or Embedded Images

Pasted images (images without a link in the Links panel) and embedded images make bloated documents. The script unembeds embedded images and saves pasted images to disk, creating links in...

This script is part of the Production and Workflow collection. See the full collection here.ย 

With this script, you can write pasted and embedded images to disk.

Sometimes you receive documents with images without links in the Links panel. These images have been pasted into the document. Other documents may contain embedded images. Embedded images have an entry in the Links panel (but usually no file path); pasted images are not shown in the Links panel at all.

For various reasons it’s better to keep images on disk and have them linked to the document. The script described here deals with both types of image โ€“ pasted and embedded.

When you run the script, it prompts you to choose an output folder using the OS’s standard dialog. If your document contains just embedded images, not pasted ones, then the script silently unembeds all embedded images, saving them in the folder you chose earlier. In doing so, the name, format, and resolution of the images are not changed.

If there are any pasted images in the document, the script displays a dialog in which you indicate which format should be used to save the images:

dialog unpaste pasted images

Indicate if you want to create links for the saved images and select an export format. There are three export formats: EPS, PNG, and JPEG.

  • PNGย This format is not available in the interface before CS6, but a script can export an image to PNG format in pre-CS6 InDesign versions. Up to CS6, images are exported at 72 ppi; this can’t be changed. From CS6 the script uses InDesign’s current PNG export settings. To change those settings, export something (a page, for instance) using the settings that you want to apply to your PNGs.
  • JPEGย When you choose to export images as JPG, the script uses the application’s current JPEG export settings. This means that before running the script, you need to apply those settings by exporting something (anything, even an empty page, will do) as JPEG using InDesign’s export dialog. Then run the script: it will use the JPEG export settings you set earlier.
  • EPSย Export to EPS is a bit trickier because rather than images, InDesign exports the whole page that contains an image. The script works around this by creating a new document with one page which is exactly the size of the image to be exported. It then duplicates the pasted image to that document, exports the image from there, and discards the document. As with JPEG, the script uses the application’s EPS export settings.

Other formats

The three formats described here are the only formats InDesign can export. Other formats are possible only by converting the images saved by the script using a graphics conversion program (e.g. SnagIt, the screen grabber, has a good batch converter). If you use Photoshop, you can use its image processor (File > Scripts > Image Processor) to batch-convert the images saved by the script.

Create links

When Create links is checked, the script saves each pasted image to disk and creates a link. Uncheck this option and the script saves the images to disk and deletes them from the document.


Version history

7 May 2018: The script now handles placed PDF pages and Illustrator pasteboards better.

16 Mar. 2018: Some pasted images refuse to relink. They are dumped on disk and removed from the document, and should be relinked manually.

1 Jan. 2018: The script sometimes overwrote existing files. Fixed.

20 June 2017: Fixed a logistic problem with storing preferences.

22 Jan. 2017: Tranformations applied to embedded/pasted graphics were ignored; fixed (pointed out by Bruno Herfst).

7 Dec. 2012: Folder handling improved.

24 Sept. 2011: The script now deals with embedded images as well (previous version dealt only with pasted images).

August 2010: First posted.


Peter Kahrel Script Repository
Hosted as a community service, and with deep appreciation, by CreativePro.com


Scripts by Topic | Script Index
Basic Script Installation and Use
How to Modify or Configure These Scripts
Resources for Scripting and Publishing Automation
About This Repository


Repository Home Page


Contact Peter Kahrel


Note to users: You run scripts at your own risk: CreativePro and the author accept no liability for anything that may be caused by any of these scripts. Always take the necessary precautions. We encourage you to save backups and test scripts on copies of your documents.

Bookmark
Please login to bookmark Close

This article was last modified on August 22, 2026

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *

Loading comments...