There are cases when you need to export sliced PDFs from InDesign. Say you are working on a "WHO is WHO" project and your final document contains 100 pages. But fact is there are 2 pages per person, and that is basically 50 persons. So eventually, you need 50 pdfs nicely named and of course, it will be time consuming and error prone to do it manually. What about using a script? 

For this kind of tasks, script come in handy. PDFKeyExporter proves it. Once your document is done, run the script. A dialog pops up and you are now able to configure how your PDFs will be sliced and named. You only need to let the script know which key you are going to use.

PDFkeyExporter UI

The dialog is made of several sections:

  1. The key to use
  2. PDF preset to use
  3. Location where to export the file
  4. Naming of the file
  5. Other options

The key

The script needs to know what will be the key element to decide where to slice your file and produce the appropriate PDFs. You can use:

  • A character style
  • A paragraph style
  • A XML tag
  • Sections

Say our "WHO is WHO" project introduces person by their name. In the InDesign Layout, a paragraph style "NAME" is applied to the text we want to grab. Pick "paragragh style" as the key and select "NAME" in the list. Evetytime a new "NAME" text is found, a new PDF is created and the name is by default the content of the text (M. DOE in our case).

But if needed, use character styles, xml tags or sections to get your PDFs correctly exported.

PDF Preset

Pick the PDF preset you want to use for your project.

Export Location

Pick the folder where you want to export your files


By default, PDFs will be named based on the found text (or section names). The "$" sign refers to this text. But feel free to use other variables such as:

  • [[DOC]] : the current document name
  • [[FPG]] : the name of the page where the text is found
  • [[TPG]] : the total of pages in the current document
  • [[PGR]] : the range of pages for the exported sequence

Other options

You can also use the following options:

  • Background Export : export PDF files in the background letting you use InDesign during exports
  • Open Folder : open folder after export
  • Open PDFs : open PDFs after export
  • Overwrite files : overwrites existing files
  • Keep data: saves UI selections
  • Use as a delimiter : inform the script that you wan to export all pages included in a sequence. For ex, if a key is found on pages 1 and 5, the first PDF will contain 4 pages (1-4).

Designed en 2010 !

This script was designed in 2010 when we were using InDesign CS5. But it works with CC2023 without a hitch. Of course, if you are having troubles using it, let us know. And if you find this script useful, consider donation ;)

To download the file, you can go here:





No thoughts on “Export sliced PDF with a custom key”

Leave your comment

In reply to Some User



An original idea from Loic Aigon, designed by Eddy.VH. It 's a scripts library for Desktop Publishing Adobe products. Find Javascript for Photoshop, Illustrator, inDesign and Acrobat or ATN scripts ( Photoshop actions ) you need.