Export Layers

Script for Adobe InDesign
Latest update 8/31/2022, version 2.6

Export a separate image or PDF of each layer used on each page of a document.

  • Size to page or contents only
  • Configure file naming
  • Export JPG, PDF (interactive or print), or PNG
  • Save and restore all settings
Download
Export Layers

FREE to download
Please make a contribution

Many scripts are free to download thanks to the support of users. Help me keep developing new scripts by supporting my work. Click the button to make a contribution of any amount. Thank you.

How-to Video

How to use the script

The interface has five sections: Size, File naming, Options, Output, and Settings. Set the desired options and click the OK button to begin. A progress bar is displayed as layers are exported.

Section 1: Size

Page — output size matches the document page size, plus bleed if enabled in the script interface (JPG and PNG) or enabled in the PDF preset used to output print PDFs.

Content — output size matches the boundaries of content that exists on each layer. This can result in output of varying sizes, depending on the design of the layout and the precise items that appear on each layer of each page.

Section 2: File naming

Include document name — at a minimum the output file names are the layer names plus page number. Enable this option to also include the document name.

Page label at — select Begin to prefix file names with the page label (page number), or select End to append page labels to file names as a suffix.

Separator — any characters to insert between the document name (if included), the layer name, and the page label. Default is a single underscore.

Numbering minimum digits — controls how page labels are prefixed with zeros to become a minimum number of digits. This prevents the erroneous file sorting behavior still present in some systems, in which 10 precedes 2 because 1 precedes 2, even though 10 is greater in value. By adding a prefix of zeros, the same example instead becomes 002 and 010, which sort correctly in any file system.

Section 3: Options

Periods — when enabled, periods within the file name are either removed, converted to a dash, or converted to an underscore. This does not include the period before the extension, which is never removed or replaced.

Spaces — when enabled, spaces within the file name are either removed, converted to a dash, or converted to an underscore.

Letter case — when enabled, the file name is converted to either all lowercase or all uppercase.

Remove diacritics — characters with diacritics, such as accents, are converted to the equivalent basic glyph.

Section 4: Output

Folder — the folder to which layers are exported. The default is the folder where the InDesign document is located. Click the button Folder to select another. To the right is a button with three dots that opens another window with more output folder options.

Output folder more options
Output folder window

Here, recent folders are listed. Click one, and it becomes the output folder.

It’s also possible to set a folder as the default each time the script runs. Below the list is Default output folder. Click the button Set default, and choose the desired folder. Then whenever the script runs, the output folder is the same. Or leave the default (none), and it’s always where the document is located.

Pages: All or Range — controls whether to export all pages of the document, a single page, or any range or ranges of pages. For a single page or a range, the normal InDesign rules for identifying pages are recognized. Use section and/or alternate layout prefixes combined with the page number as it appears in the layout, or enter the plus sign followed by the absolute page number. Separate the first and last pages of a range with a hyphen, and separate multiple pages or page ranges with a comma.

Pages or Spreads — from the drop-down list, choose to export either Pages or Spreads.

Layers: All — every layer is output even if hidden or locked.

Layers: Visible — only visible layers are output. Hidden layers are ignored.

Layers: Unlocked — only unlocked layers are output. Locked layers are ignored.

Layers: Each unlocked combined with all locked — locked layers are not output rather included in the output of each unlocked layer. Use this for common layers such as base images and illustrations to combine with differing text layers, for example, different languages. Lock the layers for the base artwork, unlock the text layers for each language, and enable this option.

Replace existing output files — when enabled, existing output files are replaced. When disabled and an existing file is detected, an incremental number is added to the file name to prevent overwriting the existing file.

Format — the file format to which pages are exported. The available choices are JPG, PDF (interactive), PDF (Print), and PNG. Each format offers different options described next.

JPG

Resolution — pixels per inch used to rasterize the pages.

Color Space — choose RGB, CMYK, or Gray.

Quality — choose Maximum, High, Medium, or Low.

Embed Profile — embeds the current color profile.

Bleed — includes document bleed, if any. This option is ignored when the size option is set to content only, not the entire page.

PDF (Interactive)

Resolution — pixels per inch for images.

Quality — image quality. Choose Maximum, High, Medium, or Low.

PDF (Print)

PDF preset — the PDF preset used to export the pages.

PDF (Interactive and Print)

Each layer and page — a separate single-page PDF is output for each layer from each page of the document.

Each layer all pages — a separate PDF is output for each layer, each of which contains the layer from all pages of the document.

Export in background — when enabled, PDFs are queued to export in the background, and the script ends sooner. When disabled, each PDF page is exported immediately, and the script is active until all PDFs are exported. When exporting a great number of pages, it is best to disable this option.

PNG

Resolution — pixels per inch used to rasterize the pages.

Color Space — choose RGB or Gray.

Quality — choose Maximum, High, Medium, or Low.

Transparent — areas of the layer uncolored are transparent.

Bleed — includes document bleed, if any. This option is ignored when the size option is set to content only, not the entire page.

A note about JPG and PNG: there isn’t an option for anti-alias because the script always enables anti-alias when exporting either image format. I couldn’t imagine a need to disable the option considering that without anti-alias, the result is horrible. But perhaps I could be wrong, and there is a need to disable it. Contact me to share other views on the subject.

Section 5: Settings

The current options may be saved and restored later. Select from the Load drop-down list to choose saved settings, and the current options are updated. Click the Delete button, and the saved settings selected in the Load drop-down list are permanently removed. Click the Save button, provide a name for the settings, and the current options are preserved. If the name already exists, the user may choose to replace the saved settings. Or click the checkbox Replace settings, and choose the settings to replace.

The script provides default saved settings named [Default]. These settings cannot be deleted but may be updated to the current values. Save settings, click the checkbox Replace settings, and choose [Default].

When settings are saved, there is also the option to include Output folder.

Export Layers Save settings

Each time the script is launched, the output folder defaults to the location of the InDesign document. To override the default, enable the option to include Output folder. Then when the saved settings are loaded, the output folder is restored to the value set when the settings were saved. This includes the next launch of the script, as the last settings selected are also restored.

Many scripts are free to download thanks to the support of users. Help me keep developing new scripts by supporting my work. Click the button to make a contribution of any amount. Thank you.
Download
Export Layers

For help installing scripts, see How to Install and Use Scripts in Adobe Creative Cloud Applications.

Also available for hire to program custom solutions. Contact William for more information.

IMPORTANT: by downloading any of the scripts on this page you agree that the software is provided without any warranty, express or implied. USE AT YOUR OWN RISK. Always make backups of important data.