PDF Export Single Pages
Latest update 10/7/2019, version 2.2
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
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, and those sections or layouts share duplicate page numbers, a section label is required. Otherwise output of pages of the same number would overwrite each other. In this case, Include section label is forced on (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, or all page numbers are unique.
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.
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.2 (191007)
- 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)
- Update progress window in message function.
Version 2.1 (190902)
- Fix syntax error settings.add function.
Version 2.0 (190624)
- Revise settings.
- Restore altered app preferences on completion.
Version 19.3.8 (1.11)
- Add license.
Version 19.2.24 (1.10)
- Update settings file error handling.
Version 19.2.21 (1.9.1)
- If any exist, load first .i18n discovered.
- Add language key at top of i18n data.
Version 19.2.17 (1.9)
Version 18.12.9 (1.8)
- Fix typo "error has occured."
- Settings file named by title instead of app.activeScript.
- Revise settings object.
- Revise listSettings object, add settings.lock property.
- Pages all/range set once on init, not each call to configureUi.
- Fix flaw, section numbering and include section label option.
- Fix flaw, section numbering minimum digits.
- Restore (and make optional) background export.
Version 18.11.12 (1.7)
- Store settings in user data folder.
Version 18.9.26 (1.6.2)
Version 18.9.22 (1.6.1)
- Fix flaw, delete setting confirmation removes setting from UI when responding 'no.'
Version 18.8.19 (1.6)
- Add check for overset text.
- Add check for missing or modified links.
Version 18.7.18 (1.5)
- Revise settings object.
- Remove obsolete function settings restoreLast.
- Add function configureUi.
- Update progress function.
- Wrap work in process function, wrapped in try/catch.
Version 18.5.30 (1.4)
- Retain last used base name and output folder if document name hasn't changed.
Version 18.5.15 (1.3)
- Remove close button from progress bar.
- Catch processing errors and alert user.
Version 18.5.7 (1.2.1)
- Fix [Default] not resetting output folder.
Version 18.4.29 (1.2)
- Disable delete settings button when initial [Default] settings are created and no other settings yet exist.
- Export PDFs synchronously instead of asynchronously because changes in OS High Sierra seriously degrade background exporting performance.
- Because removal of background exporting, add a progress bar.
- Fix unhandled exception when saved output folder no longer exists.
Version 17.10.18 (1.1)
- Add reset button to restore default base name.
- Create saved settings [Default] if it does not exist, and saved settings file if it does not exist.
- Disable delete settings button if none are selected or [Default] is selected.
- Allow disabling Use section label when all page numbers are unique, even when multiple sections/layouts exist.