PDF Export Single Pages

JavaScript for Adobe InDesign
Latest update 4/26/2021, version 2.4

Export an InDesign document to single-page PDFs using a selected PDF Preset. Much of my workload is magazines and books, projects that demand working in single pages because of the many page corrections over the lifetime of the project. Exporting the entire document every correction is not only a waste of time, it means regenerating PDFs of approved pages—a risk of error I’d rather avoid. Existing tools to generate single pages did not meet my specific desires, so I wrote my own script, shared here to help others with similar needs.

  • Page labels at the beginning or end of output file names
  • Absolute (document) numbering or by section
  • Set minimum digits to prefix section and page labels
  • Preview output file name before proceeding
  • Export all pages, a single page, or any range or ranges of pages
  • Export using any defined PDF Preset
  • Immediate or background export
  • Save and restore all settings
  • User-configurable localization
PDF Export Single Pages screen 1
PDF Export Single Pages

You decide. Reward the author an
amount the solution is worth to you.

How-to Video

Instructions for use

The interface has four sections: File naming, Preview, Output, and Settings. Set desired options then click OK button to begin. A progress bar is displayed as pages are exported.

Section 1: File naming

Base name — defaults to the InDesign document name minus file extension and may be revised to any value provided it is a valid file name. Do not include extension; “.pdf” is added to the base name and unique label for each page exported. For saved settings that include base name, the value from the settings is used rather than the default. Use the Reset button to restore the default.

Reset — restores base name to default (document name minus extension).

Page label at — the choice to begin the file name with the label, or end the file name with the label.

Separator — any characters to insert between the base name, the section label, and the page label. Default is a single underscore.

Numbering: Document — pages are labeled by their sequence in the document (absolute numbering). Sections and how page numbers appear in the layout are ignored. The first page of the document is always labeled 1, the second is always labeled 2, etc., until reaching the last physical page of the document. For example, “basename_001.pdf” (first page of the document).

Numbering: Sections — pages are labeled by section and page number as it appears in the layout. For example, “basename_01_001.pdf” (section 1, page 1). Section labels are not the textual prefix assigned to sections of the document, rather Arabic numerals representing their sequence in the document, beginning at Number sections starting at (see below for more details). Page labels are Arabic numerals equivalent to the page number as it appears in the layout. For example, page “8” is labeled 8, as well as page “viii” is labeled 8. When a new section begins, the section label is incremented, for example, “basename_02_001.pdf” (section 2, page 1). And so on.

Whether numbering by document or by section, the goal is to produce single-page PDFs that sort naturally in the intended order. Otherwise, when flowing pages into a prepress workflow, the operator has to manually position pages in the run list, which is prone to error. The added benefit of section numbering is that page labels match the page numbers as they appear in the layout, which also reduces confusion and the potential for error.

Minimum digits — controls how section and 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.

Minimum digits for sections and pages may be adjusted to any value provided it is no less than the document requires. For example, if a document contains 100 pages, it is not possible to set the minimum digits for pages to less than 3. The same applies to section labels.

Include section label — when the document contains multiple sections or alternate layouts, a section label is required, otherwise output of pages of the same sequence number within a later section would overwrite pages from prior sections. In this case, Include section label is enforced (checked but disabled so that it may not be unchecked). The choice to disable is available only when the document contains a single section and no alternate layouts.

The option to exclude a section label is useful when a project is broken into separate documents, each a single section, but each is a unique range of page numbers. Once all combined, the project becomes a continuous page range, making section labels unnecessary. In such a case, there is no harm in having a section label, but it is excess and may not be desired.

IMPORTANT: the script has no means to know if multiple documents from a single project have overlapping page ranges. Ignoring this could lead to overwriting pages that mistakenly share the same number, regardless of including a section label or not. For such a project, first ensure each document uses a unique page range that makes sense once combined — no pages with the same number, and no gaps in the page number sequence.

Number sections starting at — the number applied to the document’s initial section, which is then incremented each section that follows.

Section 2: Preview

An example output file name based on the current choices. As options change, the preview will update to show a new example. The example represents the first page of the inDesign document. The value set for pages to output, whether all or a range, is not reflected in the preview.

Section 3: Output

Folder — the folder to which PDF pages are exported. Default is the folder where the InDesign document is located, unless saved settings are loaded that include a specific output folder.

Pages: All or Range — controls whether to export all pages of the documents, 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.

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

Replace existing output files — when enabled, existing output files are replaced without user intervention. When disabled, the user is prompted to confirm the replacement of each existing output file.

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 exporting all PDFs is completed.

Section 4: Settings

The current options may be saved and restored later. Select from the Load drop-down list to choose saved settings, which then updates the current options. 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.

When settings are saved, there is also the choice to include Base name and/or Output folder.

PDF Export Single Pages screeen 2

If the saved settings are for a project that always uses a particular base name and/or always outputs to a particular folder, either or both of these choices may be enabled and the values are preserved. If omitted, when the saved settings are loaded, the base name and/or output folder remain the default value.

The script provides default saved settings named [Default]. These settings cannot be deleted but may be updated to any desired values by saving settings and providing the name [Default], which then overwrites the default settings.

Each time processing begins, the current options are preserved, and the next time the script is launched, options are restored to the last values used. IMPORTANT NOTE: because of the script functionality to retain Base name and/or Output folder, these values from the last settings used may not be desired. To restore base name to default, click the Reset button right of the base name input field. To override the output folder, manually select the desired folder. You may also change both values by selecting other saved settings. As well, the built-in [Default] settings restores the default base name and output folder.


The script provides user-configurable localization. By default the script language is US English, which does not require further download or configuration. For other languages, download the Language Pack and copy the i18n file for the desired language to the script folder alongside the script file. When launched, the script detects the i18n file and the interface displays the language. If the desired language is not present in the language pack, edit the English i18n file to translate to the desired language, and copy the edited i18n file to the script folder alongside the script file. For details of how to edit and install i18n files, read How to Localize Scripts.

PDF Export Single Pages

License details included in download

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

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


Version 2.4 (210426)

  1. Improved error handling and preferences preservation.

Version 2.3.1 (210321)

  1. Alert and confirm supply all arguments.

Version 2.3 (201026)

  1. On click option export background, clear settings name.
  2. Enforce section label when section numbering and multiple sections.
  3. Remove legacy settings.

Version 2.2.3 (201013)

  1. UI consistency.
  2. Miscellaneous.

Version 2.2.2 (191220)

  1. Fix window button return value problem with Windows close button.

Version 2.2.1 (191217)

  1. Disable/restore export preference view PDF.

Version 2.2 (191007)

  1. Restore check for unique pages removed at version 1.8. Entire check was removed when only needed to remove conversion of page label to number.

Version 2.1.1 (190911)

  1. Update progress window in message function.

Version 2.1 (190902)

  1. Fix syntax error settings.add function.
  2. Miscellaneous.

Version 2.0 (190624)

  1. Revise settings.
  2. Restore altered app preferences on completion.
  3. Miscellaneous.

Version 19.3.8 (1.11)

  1. Add license.

Version 19.2.24 (1.10)

  1. Update settings file error handling.
  2. Miscellaneous.

Version 19.2.21 (1.9.1)

  1. If any exist, load first .i18n discovered.
  2. Add language key at top of i18n data.

Version 19.2.17 (1.9)

  1. Internationalization.
  2. Miscellaneous.

Version 18.12.9 (1.8)

  1. Fix typo "error has occured."
  2. Settings file named by title instead of app.activeScript.
  3. Revise settings object.
  4. Revise listSettings object, add settings.lock property.
  5. Pages all/range set once on init, not each call to configureUi.
  6. Fix flaw, section numbering and include section label option.
  7. Fix flaw, section numbering minimum digits.
  8. Restore (and make optional) background export.
  9. Miscellaneous.

Version 18.11.12 (1.7)

  1. Store settings in user data folder.

Version 18.9.26 (1.6.2)

  1. Miscellaneous.

Version 18.9.22 (1.6.1)

  1. Fix flaw, delete setting confirmation removes setting from UI when responding 'no.'

Version 18.8.19 (1.6)

  1. Add check for overset text.
  2. Add check for missing or modified links.

Version 18.7.18 (1.5)

  1. Revise settings object.
  2. Remove obsolete function settings restoreLast.
  3. Add function configureUi.
  4. Update progress function.
  5. Wrap work in process function, wrapped in try/catch.
  6. Miscellaneous.

Version 18.5.30 (1.4)

  1. Retain last used base name and output folder if document name hasn't changed.

Version 18.5.15 (1.3)

  1. Remove close button from progress bar.
  2. Catch processing errors and alert user.

Version 18.5.7 (1.2.1)

  1. Fix [Default] not resetting output folder.

Version 18.4.29 (1.2)

  1. Disable delete settings button when initial [Default] settings are created and no other settings yet exist.
  2. Export PDFs synchronously instead of asynchronously because changes in OS High Sierra seriously degrade background exporting performance.
  3. Because removal of background exporting, add a progress bar.
  4. Fix unhandled exception when saved output folder no longer exists.

Version 17.10.18 (1.1)

  1. Add reset button to restore default base name.
  2. Create saved settings [Default] if it does not exist, and saved settings file if it does not exist.
  3. Disable delete settings button if none are selected or [Default] is selected.
  4. Allow disabling Use section label when all page numbers are unique, even when multiple sections/layouts exist.